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

Unified Diff: ui/aura/gestures/gesture_recognizer_unittest.cc

Issue 10446103: GestureScrollEnd event had non-zero velocity causing overscroll on software fling path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed unit tests Created 8 years, 7 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
« no previous file with comments | « no previous file | ui/base/gestures/gesture_sequence.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/gestures/gesture_recognizer_unittest.cc
diff --git a/ui/aura/gestures/gesture_recognizer_unittest.cc b/ui/aura/gestures/gesture_recognizer_unittest.cc
index 27f645015b1f001d47b85862aa8ecaff4071a6df..3cfd7885d05e757327ddb6058a3bafe7d495c3a8 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -130,8 +130,7 @@ class GestureEventConsumeDelegate : public TestWindowDelegate {
scroll_y_ += gesture->delta_y();
break;
case ui::ET_GESTURE_SCROLL_END:
- velocity_x_ = gesture->delta_x();
- velocity_y_ = gesture->delta_y();
+ EXPECT_TRUE(velocity_x_ == 0 && velocity_y_ == 0);
scroll_end_ = true;
break;
case ui::ET_GESTURE_PINCH_BEGIN:
@@ -148,8 +147,8 @@ class GestureEventConsumeDelegate : public TestWindowDelegate {
touch_id_ = gesture->delta_x();
break;
case ui::ET_SCROLL_FLING_START:
+ EXPECT_TRUE(gesture->delta_x() != 0 || gesture->delta_y() != 0);
EXPECT_TRUE(scroll_end_);
- EXPECT_TRUE(velocity_x_ != 0 || velocity_y_ != 0);
fling_ = true;
break;
case ui::ET_GESTURE_TAP_UP:
@@ -745,7 +744,7 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
root_window()->DispatchTouchEvent(&release);
EXPECT_TRUE(delegate->scroll_end());
- EXPECT_EQ(100000, delegate->velocity_x());
+ EXPECT_EQ(0, delegate->velocity_x());
EXPECT_EQ(0, delegate->velocity_y());
}
@@ -782,10 +781,10 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
EXPECT_TRUE(delegate->scroll_end());
EXPECT_EQ(0, delegate->velocity_x());
- EXPECT_EQ(100000, delegate->velocity_y());
+ EXPECT_EQ(0, delegate->velocity_y());
}
-// Check Scroll End Events report correct velocities
+// Check Scroll End Events reports zero velocities
// if the user is not on a rail
TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
scoped_ptr<GestureEventConsumeDelegate> delegate(
@@ -815,8 +814,8 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
root_window()->DispatchTouchEvent(&release);
EXPECT_TRUE(delegate->scroll_end());
- EXPECT_EQ(10000, delegate->velocity_x());
- EXPECT_EQ(100000, delegate->velocity_y());
+ EXPECT_EQ(0, delegate->velocity_x());
+ EXPECT_EQ(0, delegate->velocity_y());
}
// Check that appropriate touch events generate long press events
« no previous file with comments | « no previous file | ui/base/gestures/gesture_sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698