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

Unified Diff: ui/events/gesture_detection/gesture_provider_unittest.cc

Issue 1049383003: Postpone rail application for touch scrolling - chrome side. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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: ui/events/gesture_detection/gesture_provider_unittest.cc
diff --git a/ui/events/gesture_detection/gesture_provider_unittest.cc b/ui/events/gesture_detection/gesture_provider_unittest.cc
index 1f8d2d8182c005554a74f2c7e830e53bca017ad0..ca5978fae17afac6781440a8a099a522e51fb7f2 100644
--- a/ui/events/gesture_detection/gesture_provider_unittest.cc
+++ b/ui/events/gesture_detection/gesture_provider_unittest.cc
@@ -839,9 +839,10 @@ TEST_F(GestureProviderTest, ScrollUpdateValues) {
EXPECT_EQ(kFakeCoordY - delta_y + raw_offset_y, gesture.raw_y);
EXPECT_EQ(1, gesture.details.touch_points());
- // No horizontal delta because of snapping.
- EXPECT_EQ(0, gesture.details.scroll_x());
+ EXPECT_EQ(-delta_x / 2, gesture.details.scroll_x());
EXPECT_EQ(-delta_y / 2, gesture.details.scroll_y());
+ EXPECT_EQ(GestureEventDetails::ScrollRailState::Vertical,
+ gesture.details.scroll_rail_state());
}
// Verify that fractional scroll deltas are rounded as expected and that
@@ -891,8 +892,11 @@ TEST_F(GestureProviderTest, FractionalScroll) {
EXPECT_GE(gesture.details.scroll_y(), (int)delta_y);
EXPECT_LE(gesture.details.scroll_y(), ((int)delta_y) + 1);
- // And that there has been no horizontal motion at all.
- EXPECT_EQ(0, gesture.details.scroll_x());
+ // And that there has been very little horizontal motion.
+ EXPECT_GT(gesture.details.scroll_x(), 0);
+ EXPECT_LT(gesture.details.scroll_x(), 0.5);
+ EXPECT_EQ(GestureEventDetails::ScrollRailState::Vertical,
+ gesture.details.scroll_rail_state());
}
}

Powered by Google App Engine
This is Rietveld 408576698