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

Side by Side Diff: content/browser/renderer_host/input/gesture_event_queue_unittest.cc

Issue 1398153002: Don't use base::MessageLoop::{Quit,QuitClosure} in content/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 EXPECT_EQ(2U, GestureEventQueueSize()); 1080 EXPECT_EQ(2U, GestureEventQueueSize());
1081 EXPECT_EQ(2U, GestureEventDebouncingQueueSize()); 1081 EXPECT_EQ(2U, GestureEventDebouncingQueueSize());
1082 1082
1083 SimulateGestureEvent(WebInputEvent::GestureTapDown, 1083 SimulateGestureEvent(WebInputEvent::GestureTapDown,
1084 blink::WebGestureDeviceTouchscreen); 1084 blink::WebGestureDeviceTouchscreen);
1085 EXPECT_EQ(0U, GetAndResetSentGestureEventCount()); 1085 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1086 EXPECT_EQ(2U, GestureEventQueueSize()); 1086 EXPECT_EQ(2U, GestureEventQueueSize());
1087 EXPECT_EQ(3U, GestureEventDebouncingQueueSize()); 1087 EXPECT_EQ(3U, GestureEventDebouncingQueueSize());
1088 1088
1089 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( 1089 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
1090 FROM_HERE, base::MessageLoop::QuitClosure(), 1090 FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
1091 TimeDelta::FromMilliseconds(5)); 1091 TimeDelta::FromMilliseconds(5));
1092 base::MessageLoop::current()->Run(); 1092 base::MessageLoop::current()->Run();
1093 1093
1094 // The deferred events are correctly queued in coalescing queue. 1094 // The deferred events are correctly queued in coalescing queue.
1095 EXPECT_EQ(0U, GetAndResetSentGestureEventCount()); 1095 EXPECT_EQ(0U, GetAndResetSentGestureEventCount());
1096 EXPECT_EQ(5U, GestureEventQueueSize()); 1096 EXPECT_EQ(5U, GestureEventQueueSize());
1097 EXPECT_EQ(0U, GestureEventDebouncingQueueSize()); 1097 EXPECT_EQ(0U, GestureEventDebouncingQueueSize());
1098 EXPECT_FALSE(ScrollingInProgress()); 1098 EXPECT_FALSE(ScrollingInProgress());
1099 1099
1100 // Verify that the coalescing queue contains the correct events. 1100 // Verify that the coalescing queue contains the correct events.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 WebInputEvent::GestureScrollUpdate}; 1146 WebInputEvent::GestureScrollUpdate};
1147 1147
1148 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type); 1148 for (unsigned i = 0; i < sizeof(expected) / sizeof(WebInputEvent::Type);
1149 i++) { 1149 i++) {
1150 WebGestureEvent merged_event = GestureEventQueueEventAt(i); 1150 WebGestureEvent merged_event = GestureEventQueueEventAt(i);
1151 EXPECT_EQ(expected[i], merged_event.type); 1151 EXPECT_EQ(expected[i], merged_event.type);
1152 } 1152 }
1153 } 1153 }
1154 1154
1155 } // namespace content 1155 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698