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

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

Issue 235003005: Consolidate all touch/gesture related constants in content (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 8 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_event_queue_unittest.cc
diff --git a/content/browser/renderer_host/input/touch_event_queue_unittest.cc b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
index 779cf25f34c77321ed0e118788515377fabeb187..a7c8ce2a70ada7bdaa97c63812262f9531b7ea09 100644
--- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
@@ -41,12 +41,7 @@ class TouchEventQueueTest : public testing::Test,
// testing::Test
virtual void SetUp() OVERRIDE {
- ResetQueueWithParameters(touch_scrolling_mode_, slop_length_dips_);
- }
-
- virtual void SetTouchScrollingMode(TouchEventQueue::TouchScrollingMode mode) {
- touch_scrolling_mode_ = mode;
- ResetQueueWithParameters(touch_scrolling_mode_, slop_length_dips_);
+ ResetQueueWithConfig(CreateConfig());
}
virtual void TearDown() OVERRIDE {
@@ -84,13 +79,28 @@ class TouchEventQueueTest : public testing::Test,
protected:
- void SetUpForTimeoutTesting(base::TimeDelta timeout_delay) {
- queue_->SetAckTimeoutEnabled(true, timeout_delay);
+ TouchEventQueue::Config CreateConfig() {
+ TouchEventQueue::Config config;
+ config.touch_scrolling_mode = touch_scrolling_mode_;
+ config.touchmove_slop_suppression_length_dips = slop_length_dips_;
+ return config;
+ }
+
+ void SetTouchScrollingMode(TouchEventQueue::TouchScrollingMode mode) {
+ touch_scrolling_mode_ = mode;
+ ResetQueueWithConfig(CreateConfig());
}
void SetUpForTouchMoveSlopTesting(double slop_length_dips) {
slop_length_dips_ = slop_length_dips;
- ResetQueueWithParameters(touch_scrolling_mode_, slop_length_dips_);
+ ResetQueueWithConfig(CreateConfig());
+ }
+
+ void SetUpForTimeoutTesting(base::TimeDelta timeout_delay) {
+ TouchEventQueue::Config config = CreateConfig();
+ config.touch_ack_timeout_delay = timeout_delay;
+ config.touch_ack_timeout_supported = true;
+ ResetQueueWithConfig(config);
}
void SendTouchEvent(const WebTouchEvent& event) {
@@ -183,9 +193,7 @@ class TouchEventQueueTest : public testing::Test,
queue_->OnHasTouchEventHandlers(has_handlers);
}
- void SetAckTimeoutDisabled() {
- queue_->SetAckTimeoutEnabled(false, base::TimeDelta());
- }
+ void SetAckTimeoutDisabled() { queue_->SetAckTimeoutEnabled(false); }
bool IsTimeoutEnabled() const { return queue_->ack_timeout_enabled(); }
@@ -227,9 +235,8 @@ class TouchEventQueueTest : public testing::Test,
touch_event_.ResetPoints();
}
- void ResetQueueWithParameters(TouchEventQueue::TouchScrollingMode mode,
- double slop_length_dips) {
- queue_.reset(new TouchEventQueue(this, mode, slop_length_dips));
+ void ResetQueueWithConfig(const TouchEventQueue::Config& config) {
+ queue_.reset(new TouchEventQueue(this, config));
queue_->OnHasTouchEventHandlers(true);
}

Powered by Google App Engine
This is Rietveld 408576698