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

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

Issue 1408213002: Add hooks for flushing input from BeginFrame dispatch on Aura (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix build for real 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 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 2460f3f693a033f15306fdd96977e4850a32aa6d..71d0328b80f255b0263786951490207c181aebab 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -296,8 +296,8 @@ class InputRouterImplTest : public testing::Test {
return input_router()->touch_event_queue_.IsAckTimeoutEnabled();
}
- void RequestNotificationWhenFlushed() const {
- return input_router_->RequestNotificationWhenFlushed();
+ void FlushInput() const {
+ return input_router_->FlushInput(base::TimeTicks::Now());
}
size_t GetAndResetDidFlushCount() {
@@ -1565,7 +1565,7 @@ TEST_F(InputRouterImplTest, InputFlush) {
EXPECT_FALSE(HasPendingEvents());
// Flushing an empty router should immediately trigger DidFlush.
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(1U, GetAndResetDidFlushCount());
EXPECT_FALSE(HasPendingEvents());
@@ -1576,7 +1576,7 @@ TEST_F(InputRouterImplTest, InputFlush) {
EXPECT_TRUE(HasPendingEvents());
// DidFlush should be called only after the event is ack'ed.
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
SendTouchEventACK(WebInputEvent::TouchStart,
INPUT_EVENT_ACK_STATE_NOT_CONSUMED, touch_press_event_id);
@@ -1595,11 +1595,11 @@ TEST_F(InputRouterImplTest, InputFlush) {
blink::WebGestureDeviceTouchscreen);
SimulateGestureEvent(WebInputEvent::GesturePinchUpdate,
blink::WebGestureDeviceTouchscreen);
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
// Repeated flush calls should have no effect.
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
// There are still pending gestures.
@@ -1634,7 +1634,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
EXPECT_TRUE(HasPendingEvents());
// If the fling is unconsumed, the flush is complete.
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
SimulateGestureEvent(WebInputEvent::GestureScrollBegin,
blink::WebGestureDeviceTouchscreen);
@@ -1650,7 +1650,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
// If the fling is consumed, the flush is complete only when the renderer
// reports that is has ended.
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
SendInputEventACK(WebInputEvent::GestureFlingStart,
INPUT_EVENT_ACK_STATE_CONSUMED);
@@ -1668,7 +1668,7 @@ TEST_F(InputRouterImplTest, InputFlushAfterFling) {
SimulateGestureEvent(WebInputEvent::GestureFlingStart,
blink::WebGestureDeviceTouchscreen);
ASSERT_TRUE(HasPendingEvents());
- RequestNotificationWhenFlushed();
+ FlushInput();
EXPECT_EQ(0U, GetAndResetDidFlushCount());
input_router()->OnMessageReceived(InputHostMsg_DidStopFlinging(0));
EXPECT_EQ(1U, GetAndResetDidFlushCount());

Powered by Google App Engine
This is Rietveld 408576698