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

Unified Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 10916095: Fix leaks in aura_unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/event_filter_unittest.cc ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_recognizer_unittest.cc
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 6c18f6c211e3590db13ac87a4bedce08d5818fb7..5d537e50fe79515cf73295c09c1f277add93a25e 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -1815,11 +1815,11 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) {
ui::GestureConfiguration::
set_max_separation_for_gesture_touches_in_pixels(499);
- scoped_array<gfx::Rect*> window_bounds(new gfx::Rect*[kNumWindows]);
- window_bounds[0] = new gfx::Rect(0, 0, 1, 1);
- window_bounds[1] = new gfx::Rect(500, 0, 1, 1);
- window_bounds[2] = new gfx::Rect(0, 500, 1, 1);
- window_bounds[3] = new gfx::Rect(500, 500, 1, 1);
+ scoped_array<gfx::Rect> window_bounds(new gfx::Rect[kNumWindows]);
+ window_bounds[0] = gfx::Rect(0, 0, 1, 1);
+ window_bounds[1] = gfx::Rect(500, 0, 1, 1);
+ window_bounds[2] = gfx::Rect(0, 500, 1, 1);
+ window_bounds[3] = gfx::Rect(500, 500, 1, 1);
scoped_array<aura::Window*> windows(new aura::Window*[kNumWindows]);
@@ -1828,9 +1828,9 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) {
for (int i = 0; i < kNumWindows; ++i) {
delegates[i] = new GestureEventConsumeDelegate();
windows[i] = CreateTestWindowWithDelegate(
- delegates[i], i, *window_bounds[i], NULL);
+ delegates[i], i, window_bounds[i], NULL);
windows[i]->set_id(i);
- ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i]->origin(),
+ ui::TouchEvent press(ui::ET_TOUCH_PRESSED, window_bounds[i].origin(),
i, GetTime());
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);
}
@@ -1877,6 +1877,12 @@ TEST_F(GestureRecognizerTest, GestureEventTouchLockSelectsCorrectWindow) {
target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000));
EXPECT_EQ("2", WindowIDAsString(target));
+
+ for (int i = 0; i < kNumWindows; ++i) {
+ // Delete windows before deleting delegates.
+ delete windows[i];
+ delete delegates[i];
+ }
}
// Check that touch events outside the root window are still handled
« no previous file with comments | « ui/aura/event_filter_unittest.cc ('k') | ui/aura/root_window_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698