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

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

Issue 10826209: gestures: Generate only either scroll-end or fling-start events at the end of a scroll gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove-webkit-hack Created 8 years, 4 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 | « ui/app_list/pagination_model.cc ('k') | 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 00d1302c7bd893664a9aa407bf17285634cd8d12..4391fe7af5a1879f15e99b16ce9cfa3b78f813f0 100644
--- a/ui/aura/gestures/gesture_recognizer_unittest.cc
+++ b/ui/aura/gestures/gesture_recognizer_unittest.cc
@@ -164,8 +164,10 @@ class GestureEventConsumeDelegate : public TestWindowDelegate {
case ui::ET_SCROLL_FLING_START:
EXPECT_TRUE(gesture->details().velocity_x() != 0 ||
gesture->details().velocity_y() != 0);
- EXPECT_TRUE(scroll_end_);
+ EXPECT_FALSE(scroll_end_);
fling_ = true;
+ velocity_x_ = gesture->details().velocity_x();
+ velocity_y_ = gesture->details().velocity_y();
break;
case ui::ET_GESTURE_TWO_FINGER_TAP:
two_finger_tap_ = true;
@@ -859,8 +861,9 @@ TEST_F(GestureRecognizerTest, GestureEventHorizontalRailFling) {
kTouchId, GetTime());
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
- EXPECT_TRUE(delegate->scroll_end());
- EXPECT_EQ(0, delegate->velocity_x());
+ EXPECT_TRUE(delegate->fling());
+ EXPECT_FALSE(delegate->scroll_end());
+ EXPECT_GT(delegate->velocity_x(), 0);
EXPECT_EQ(0, delegate->velocity_y());
}
@@ -895,9 +898,10 @@ TEST_F(GestureRecognizerTest, GestureEventVerticalRailFling) {
kTouchId, GetTime());
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
- EXPECT_TRUE(delegate->scroll_end());
+ EXPECT_TRUE(delegate->fling());
+ EXPECT_FALSE(delegate->scroll_end());
EXPECT_EQ(0, delegate->velocity_x());
- EXPECT_EQ(0, delegate->velocity_y());
+ EXPECT_GT(delegate->velocity_y(), 0);
}
// Check Scroll End Events reports zero velocities
@@ -929,9 +933,10 @@ TEST_F(GestureRecognizerTest, GestureEventNonRailFling) {
kTouchId, GetTime());
root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);
- EXPECT_TRUE(delegate->scroll_end());
- EXPECT_EQ(0, delegate->velocity_x());
- EXPECT_EQ(0, delegate->velocity_y());
+ EXPECT_TRUE(delegate->fling());
+ EXPECT_FALSE(delegate->scroll_end());
+ EXPECT_GT(delegate->velocity_x(), 0);
+ EXPECT_GT(delegate->velocity_y(), 0);
}
// Check that appropriate touch events generate long press events
« no previous file with comments | « ui/app_list/pagination_model.cc ('k') | ui/base/gestures/gesture_sequence.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698