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

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

Issue 188833004: [Android] Properly disable the touch ack timeout during a touch sequence (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@input_log_verbose
Patch Set: Timeout tweaks Created 6 years, 9 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 e08e775c6c6722612e6d9e2d209a6be9ee2d0cac..37fe46258795bafa80027e102ce7deb2bfa29edf 100644
--- a/content/browser/renderer_host/input/input_router_impl_unittest.cc
+++ b/content/browser/renderer_host/input/input_router_impl_unittest.cc
@@ -288,7 +288,7 @@ class InputRouterImplTest : public testing::Test {
return count;
}
- static void Wait(base::TimeDelta delay) {
+ static void RunTasksAndWait(base::TimeDelta delay) {
base::MessageLoop::current()->PostDelayedTask(
FROM_HERE, base::MessageLoop::QuitClosure(), delay);
base::MessageLoop::current()->Run();
@@ -1005,7 +1005,7 @@ TEST_F(InputRouterImplTest, TouchAckTimeoutConfigured) {
EXPECT_FALSE(TouchEventTimeoutEnabled());
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kTouchAckTimeoutDelayMs, "5");
+ switches::kTouchAckTimeoutDelayMs, "1");
TearDown();
SetUp();
ASSERT_TRUE(TouchEventTimeoutEnabled());
@@ -1015,7 +1015,7 @@ TEST_F(InputRouterImplTest, TouchAckTimeoutConfigured) {
SendTouchEvent();
EXPECT_EQ(0U, ack_handler_->GetAndResetAckCount());
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
- Wait(base::TimeDelta::FromMilliseconds(15));
+ RunTasksAndWait(base::TimeDelta::FromMilliseconds(2));
// The timed-out event should have been ack'ed.
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
@@ -1082,7 +1082,7 @@ TEST_F(InputRouterImplTest, TouchAckTimeoutConfigured) {
TEST_F(InputRouterImplTest,
TouchAckTimeoutDisabledForTouchSequenceAfterTouchActionNone) {
CommandLine::ForCurrentProcess()->AppendSwitchASCII(
- switches::kTouchAckTimeoutDelayMs, "5");
+ switches::kTouchAckTimeoutDelayMs, "1");
TearDown();
SetUp();
ASSERT_TRUE(TouchEventTimeoutEnabled());
@@ -1114,7 +1114,7 @@ TEST_F(InputRouterImplTest,
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
// Delay the ack. The timeout should *not* fire.
- Wait(base::TimeDelta::FromMilliseconds(15));
+ RunTasksAndWait(base::TimeDelta::FromMilliseconds(2));
EXPECT_EQ(0U, ack_handler_->GetAndResetAckCount());
EXPECT_EQ(0U, GetSentMessageCountAndResetSink());
@@ -1140,7 +1140,7 @@ TEST_F(InputRouterImplTest,
EXPECT_EQ(1U, GetSentMessageCountAndResetSink());
// Wait for the touch ack timeout to fire.
- Wait(base::TimeDelta::FromMilliseconds(15));
+ RunTasksAndWait(base::TimeDelta::FromMilliseconds(2));
EXPECT_EQ(1U, ack_handler_->GetAndResetAckCount());
}
« no previous file with comments | « content/browser/renderer_host/input/input_router_impl.cc ('k') | content/browser/renderer_host/input/touch_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698