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

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

Issue 183013010: Don't send touchcancel on touch scroll start (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a couple tests 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/touch_action_browsertest.cc
diff --git a/content/browser/renderer_host/input/touch_action_browsertest.cc b/content/browser/renderer_host/input/touch_action_browsertest.cc
index 5fc0704767f837edf49e7033b47d0f48336ba155..c46d0415b34be299a21486c5c12f0f5466f4902e 100644
--- a/content/browser/renderer_host/input/touch_action_browsertest.cc
+++ b/content/browser/renderer_host/input/touch_action_browsertest.cc
@@ -11,6 +11,7 @@
#include "content/browser/renderer_host/input/synthetic_gesture_controller.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target.h"
#include "content/browser/renderer_host/input/synthetic_smooth_scroll_gesture.h"
+#include "content/browser/renderer_host/input/touch_event_queue.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/input/synthetic_gesture_params.h"
@@ -181,10 +182,14 @@ IN_PROC_BROWSER_TEST_F(TouchActionBrowserTest, MAYBE_DefaultAuto) {
EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchstart"));
EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchmove"));
- // Note, if we ship touch-absorption (crbug.com/346693) this will change to
- // 1 end event and 0 cancel events.
- EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchend"));
- EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
+ if (TouchEventQueue::TOUCH_SCROLLING_MODE_DEFAULT ==
+ TouchEventQueue::TOUCH_SCROLLING_MODE_TOUCHCANCEL) {
+ EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchend"));
+ EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
+ } else {
+ EXPECT_EQ(1, ExecuteScriptAndExtractInt("eventCounts.touchend"));
+ EXPECT_EQ(0, ExecuteScriptAndExtractInt("eventCounts.touchcancel"));
+ }
}
// Verify that touching a touch-action: none region disables scrolling and

Powered by Google App Engine
This is Rietveld 408576698