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

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: Compilation fixes 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..6c23e984ac8f5d1320218038075b7227e0bf68b0 100644
--- a/content/browser/renderer_host/input/touch_event_queue_unittest.cc
+++ b/content/browser/renderer_host/input/touch_event_queue_unittest.cc
@@ -40,14 +40,7 @@ class TouchEventQueueTest : public testing::Test,
virtual ~TouchEventQueueTest() {}
// 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_);
- }
+ virtual void SetUp() OVERRIDE { ResetQueueWithConfig(CreateConfig()); }
virtual void TearDown() OVERRIDE {
queue_.reset();
@@ -83,14 +76,28 @@ class TouchEventQueueTest : public testing::Test,
}
protected:
+ 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 SetUpForTimeoutTesting(base::TimeDelta timeout_delay) {
- queue_->SetAckTimeoutEnabled(true, timeout_delay);
+ 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 +190,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 +232,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