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

Unified Diff: content/browser/renderer_host/input/input_router_impl_unittest.cc

Issue 660663002: Clear pending events upon main frame navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates Created 6 years, 1 month 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
Index: content/browser/renderer_host/input/input_router_impl_unittest.cc
diff --git a/content/browser/renderer_host/input/input_router_impl_unittest.cc b/content/browser/renderer_host/input/input_router_impl_unittest.cc
index ed922c9d8ac272bdfd881c47d2b7d8b56add403c..fda01a81c409f66a98a9cda8ab63f8676dd643f2 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -287,8 +287,8 @@ class InputRouterImplTest : public testing::Test {
return input_router()->touch_event_queue_.IsAckTimeoutEnabled();
}
- void Flush() const {
- return input_router_->Flush();
+ void RequestFlushedNotification() const {
+ return input_router_->RequestFlushedNotification();
}
size_t GetAndResetDidFlushCount() {
@@ -813,7 +813,6 @@ TEST_F(InputRouterImplTest, TouchEventQueue) {
// events and the outstanding ack is received.
TEST_F(InputRouterImplTest, TouchEventQueueFlush) {
OnHasTouchEventHandlers(true);
- EXPECT_TRUE(client_->has_touch_handler());
EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
EXPECT_TRUE(TouchEventQueueEmpty());
@@ -830,7 +829,6 @@ TEST_F(InputRouterImplTest, TouchEventQueueFlush) {
// The page stops listening for touch-events. Note that flushing is deferred
// until the outstanding ack is received.
OnHasTouchEventHandlers(false);
- EXPECT_FALSE(client_->has_touch_handler());
EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
EXPECT_FALSE(TouchEventQueueEmpty());
EXPECT_TRUE(input_router_->ShouldForwardTouchEvent());
@@ -1551,7 +1549,7 @@ TEST_F(InputRouterImplTest, InputFlush) {
EXPECT_FALSE(HasPendingEvents());
// Flushing an empty router should immediately trigger DidFlush.
- Flush();
+ RequestFlushedNotification();
EXPECT_EQ(1U, GetAndResetDidFlushCount());
EXPECT_FALSE(HasPendingEvents());
@@ -1562,7 +1560,7 @@ TEST_F(InputRouterImplTest, InputFlush) {
EXPECT_TRUE(HasPendingEvents());
// DidFlush should be called only after the event is ack'ed.
- Flush();
+ RequestFlushedNotification();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
SendInputEventACK(WebInputEvent::TouchStart,
INPUT_EVENT_ACK_STATE_NOT_CONSUMED);
@@ -1581,11 +1579,11 @@ TEST_F(InputRouterImplTest, InputFlush) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GesturePinchUpdate,
blink::WebGestureDeviceTouchscreen);
- Flush();
+ RequestFlushedNotification();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
// Repeated flush calls should have no effect.
- Flush();
+ RequestFlushedNotification();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
// There are still pending gestures.
@@ -1907,4 +1905,8 @@ TEST_F(InputRouterImplTest, OverscrollDispatch) {
client_overscroll.current_fling_velocity);
}
+TEST_F(InputRouterImplTest, TouchFlushedOnDestruction) {
+ // TODO(jdduke): Implement.
+}
+
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698