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

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

Issue 859973003: Touch emulator: enables double tap support for pages similar to Chrome on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: frame_metadata_util Created 5 years, 11 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/touch_emulator_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_emulator_unittest.cc b/content/browser/renderer_host/input/touch_emulator_unittest.cc
index 440e39afffa32c20968beb241052da9e8f9e07fa..4b8bd1d5d6e4b9bf6f7bff1267288d9c8364e6b4 100644
--- a/content/browser/renderer_host/input/touch_emulator_unittest.cc
+++ b/content/browser/renderer_host/input/touch_emulator_unittest.cc
@@ -53,6 +53,7 @@ class TouchEmulatorTest : public testing::Test,
#endif
emulator_.reset(new TouchEmulator(this));
+ emulator_->SetDoubleTapSupportForPageEnabled(false);
emulator_->Enable(ui::GestureProviderConfigType::GENERIC_MOBILE);
}
@@ -283,6 +284,20 @@ TEST_F(TouchEmulatorTest, Touch) {
ExpectedEvents());
}
+TEST_F(TouchEmulatorTest, DoubleTapSupport) {
+ emulator()->SetDoubleTapSupportForPageEnabled(true);
+ MouseMove(100, 200);
+ EXPECT_EQ("", ExpectedEvents());
+ MouseDown(100, 200);
+ EXPECT_EQ("TouchStart GestureTapDown", ExpectedEvents());
+ MouseUp(100, 200);
+ EXPECT_EQ("TouchEnd GestureTapUnconfirmed", ExpectedEvents());
+ MouseDown(100, 200);
+ EXPECT_EQ("TouchStart GestureTapCancel GestureTapDown", ExpectedEvents());
+ MouseUp(100, 200);
+ EXPECT_EQ("TouchEnd GestureTapCancel GestureDoubleTap", ExpectedEvents());
+}
+
TEST_F(TouchEmulatorTest, MultipleTouches) {
MouseMove(100, 200);
EXPECT_EQ("", ExpectedEvents());
« no previous file with comments | « content/browser/renderer_host/input/touch_emulator.cc ('k') | content/browser/renderer_host/render_widget_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698