OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |