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

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

Issue 1053823002: [Android] Disable fling cancel filtering in the GestureEventQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup, working tests Created 5 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/gesture_event_queue_unittest.cc
diff --git a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
index 0bc3879a367c762ab69411af906855cdab8d7bb2..7879b3ed723e89f428edc226db4f68e9282a71f5 100644
--- a/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/gesture_event_queue_unittest.cc
@@ -73,6 +73,12 @@ class GestureEventQueueTest : public testing::Test,
return GestureEventQueue::Config();
}
+ void SetUpForGFCFilteringDisabled() {
+ GestureEventQueue::Config config;
+ config.enable_fling_cancel_filtering = false;
+ queue_.reset(new GestureEventQueue(this, this, config));
+ }
+
void SetUpForDebounce(int interval_ms) {
queue()->set_debounce_interval_time_ms_for_testing(interval_ms);
}
@@ -1066,6 +1072,18 @@ INSTANTIATE_TEST_CASE_P(AllSources,
blink::WebGestureDeviceTouchpad));
#endif // GTEST_HAS_PARAM_TEST
+TEST_F(GestureEventQueueTest, GestureFlingCancelFilteringDisabled) {
+ SetUpForGFCFilteringDisabled();
+
+ // If so configured, GFC events should never be filtered, even if there are
+ // no active flings.
+ SimulateGestureEvent(WebInputEvent::GestureFlingCancel,
+ blink::WebGestureDeviceTouchscreen);
+ EXPECT_EQ(0, ActiveFlingCount());
+ EXPECT_EQ(1U, GetAndResetSentGestureEventCount());
+ EXPECT_EQ(1U, GestureEventQueueSize());
+}
+
// Test that a GestureScrollEnd | GestureFlingStart are deferred during the
// debounce interval, that Scrolls are not and that the deferred events are
// sent after that timer fires.

Powered by Google App Engine
This is Rietveld 408576698