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

Unified Diff: content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java

Issue 18850005: Disable double tap zoom on mobile sites, to remove 300ms click delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 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
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java
diff --git a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java
index f709056afbc49aadb60b19c7cde09aab72d5a8f8..36ad4117ef7ed9e9e1da44881060d6b515637e23 100644
--- a/content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java
+++ b/content/public/android/javatests/src/org/chromium/content/browser/ContentViewGestureHandlerTest.java
@@ -1806,13 +1806,14 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
}
/**
- * Verify that no double tap gestures are created if the page has a fixed
- * page scale.
+ * Verify that no double tap gestures are created if the gesture handler is
+ * told to disable double tap gesture detection (according to the logic in
+ * ContentViewCore.onRenderCoordinatesUpdated).
* @throws Exception
*/
@SmallTest
@Feature({"Gestures"})
- public void testNoDoubleTapWhenPageScaleFixed() throws Exception {
+ public void testNoDoubleTapWhenDoubleTapDisabled() throws Exception {
final long downTime = SystemClock.uptimeMillis();
final long eventTime = SystemClock.uptimeMillis();
@@ -1821,7 +1822,7 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
mGestureHandler = new ContentViewGestureHandler(
getInstrumentation().getTargetContext(), mockDelegate, mMockZoomManager,
ContentViewCore.INPUT_EVENTS_DELIVERED_AT_VSYNC);
- mGestureHandler.updateHasFixedPageScale(true);
+ mGestureHandler.updateShouldDisableDoubleTap(true);
MotionEvent event = MotionEvent.obtain(
downTime, downTime, MotionEvent.ACTION_DOWN,
@@ -1865,14 +1866,15 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
}
/**
- * Verify that double tap drag zoom feature is not invoked
- * when the page scale is fixed. The second tap sequence should be
- * treated just as the first would be.
+ * Verify that double tap drag zoom feature is not invoked when the gesture
+ * handler is told to disable double tap gesture detection (according to the
+ * logic in ContentViewCore.onRenderCoordinatesUpdated).
+ * The second tap sequence should be treated just as the first would be.
* @throws Exception
*/
@SmallTest
@Feature({"Gestures"})
- public void testNoDoubleTapDragZoomWhenPageScaleFixed() throws Exception {
+ public void testNoDoubleTapDragZoomWhenDoubleTapDisabled() throws Exception {
final long downTime1 = SystemClock.uptimeMillis();
final long downTime2 = downTime1 + 100;
@@ -1881,7 +1883,7 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
mGestureHandler = new ContentViewGestureHandler(
getInstrumentation().getTargetContext(), mockDelegate, mMockZoomManager,
ContentViewCore.INPUT_EVENTS_DELIVERED_AT_VSYNC);
- mGestureHandler.updateHasFixedPageScale(true);
+ mGestureHandler.updateShouldDisableDoubleTap(true);
MotionEvent event = motionEvent(MotionEvent.ACTION_DOWN, downTime1, downTime1);
assertTrue(mGestureHandler.onTouchEvent(event));
@@ -1934,8 +1936,8 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
}
/**
- * Verify that setting a fixed page scale during a double tap drag zoom disables
- * double tap detection after the gesture has ended.
+ * Verify that setting a fixed page scale (or a mobile viewport) during a double
+ * tap drag zoom disables double tap detection after the gesture has ended.
* @throws Exception
*/
@SmallTest
@@ -1975,8 +1977,9 @@ public class ContentViewGestureHandlerTest extends InstrumentationTestCase {
ContentViewGestureHandler.GESTURE_PINCH_BEGIN,
mockDelegate.mMostRecentGestureEvent.mType);
- // Set a fixed page scale; this should not disrupt the current double-tap gesture.
- mGestureHandler.updateHasFixedPageScale(true);
+ // Simulate setting a fixed page scale (or a mobile viewport);
+ // this should not disrupt the current double-tap gesture.
+ mGestureHandler.updateShouldDisableDoubleTap(true);
// Double tap zoom updates should continue.
event = MotionEvent.obtain(
« no previous file with comments | « content/public/android/java/src/org/chromium/content/browser/RenderCoordinates.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698