Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Side by Side Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 11878022: ui: Convert scoped_arrays to the new scoped_ptr style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/root_window_host_linux.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_vector.h" 5 #include "base/memory/scoped_vector.h"
6 #include "base/run_loop.h" 6 #include "base/run_loop.h"
7 #include "base/string_number_conversions.h" 7 #include "base/string_number_conversions.h"
8 #include "base/timer.h" 8 #include "base/timer.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 // within max_separation_for_gesture_touches_in_pixels 1922 // within max_separation_for_gesture_touches_in_pixels
1923 TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) { 1923 TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) {
1924 ui::GestureRecognizer* gesture_recognizer = 1924 ui::GestureRecognizer* gesture_recognizer =
1925 new ui::GestureRecognizerImpl(root_window()); 1925 new ui::GestureRecognizerImpl(root_window());
1926 TimedEvents tes; 1926 TimedEvents tes;
1927 root_window()->SetGestureRecognizerForTesting(gesture_recognizer); 1927 root_window()->SetGestureRecognizerForTesting(gesture_recognizer);
1928 1928
1929 ui::GestureConsumer* target; 1929 ui::GestureConsumer* target;
1930 const int kNumWindows = 4; 1930 const int kNumWindows = 4;
1931 1931
1932 scoped_array<GestureEventConsumeDelegate*> delegates( 1932 scoped_ptr<GestureEventConsumeDelegate*[]> delegates(
1933 new GestureEventConsumeDelegate*[kNumWindows]); 1933 new GestureEventConsumeDelegate*[kNumWindows]);
1934 1934
1935 ui::GestureConfiguration:: 1935 ui::GestureConfiguration::
1936 set_max_separation_for_gesture_touches_in_pixels(499); 1936 set_max_separation_for_gesture_touches_in_pixels(499);
1937 1937
1938 scoped_array<gfx::Rect> window_bounds(new gfx::Rect[kNumWindows]); 1938 scoped_ptr<gfx::Rect[]> window_bounds(new gfx::Rect[kNumWindows]);
1939 window_bounds[0] = gfx::Rect(0, 0, 1, 1); 1939 window_bounds[0] = gfx::Rect(0, 0, 1, 1);
1940 window_bounds[1] = gfx::Rect(500, 0, 1, 1); 1940 window_bounds[1] = gfx::Rect(500, 0, 1, 1);
1941 window_bounds[2] = gfx::Rect(0, 500, 1, 1); 1941 window_bounds[2] = gfx::Rect(0, 500, 1, 1);
1942 window_bounds[3] = gfx::Rect(500, 500, 1, 1); 1942 window_bounds[3] = gfx::Rect(500, 500, 1, 1);
1943 1943
1944 scoped_array<aura::Window*> windows(new aura::Window*[kNumWindows]); 1944 scoped_ptr<aura::Window*[]> windows(new aura::Window*[kNumWindows]);
1945 1945
1946 // Instantiate windows with |window_bounds| and touch each window at 1946 // Instantiate windows with |window_bounds| and touch each window at
1947 // its origin. 1947 // its origin.
1948 for (int i = 0; i < kNumWindows; ++i) { 1948 for (int i = 0; i < kNumWindows; ++i) {
1949 delegates[i] = new GestureEventConsumeDelegate(); 1949 delegates[i] = new GestureEventConsumeDelegate();
1950 windows[i] = CreateTestWindowWithDelegate( 1950 windows[i] = CreateTestWindowWithDelegate(
1951 delegates[i], i, window_bounds[i], root_window()); 1951 delegates[i], i, window_bounds[i], root_window());
1952 windows[i]->set_id(i); 1952 windows[i]->set_id(i);
1953 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i].origin(), 1953 ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i].origin(),
1954 i, tes.Now()); 1954 i, tes.Now());
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
3047 tes.LeapForward(40)); 3047 tes.LeapForward(40));
3048 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4); 3048 root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&move4);
3049 EXPECT_TRUE(delegate->scroll_update()); 3049 EXPECT_TRUE(delegate->scroll_update());
3050 EXPECT_EQ(-1, delegate->scroll_y()); 3050 EXPECT_EQ(-1, delegate->scroll_y());
3051 3051
3052 delegate->Reset(); 3052 delegate->Reset();
3053 } 3053 }
3054 3054
3055 } // namespace test 3055 } // namespace test
3056 } // namespace aura 3056 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/root_window_host_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698