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

Unified Diff: ui/views/view_unittest.cc

Issue 10479010: Gesture related changes for views: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test and add some mores Created 8 years, 6 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/views/view.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view_unittest.cc
diff --git a/ui/views/view_unittest.cc b/ui/views/view_unittest.cc
index 8acd0bb7351fbe44ce15c4209b9f7e4881b0c50c..dde736ff776f802173a290ab7fe74045b194f81d 100644
--- a/ui/views/view_unittest.cc
+++ b/ui/views/view_unittest.cc
@@ -602,6 +602,10 @@ TEST_F(ViewTest, GestureEvent) {
EXPECT_EQ(gfx::Point(10, 10), v2->location_);
EXPECT_EQ(ui::ET_UNKNOWN, v1->last_gesture_event_type_);
+ // Simular an up so that RootView is no longer targetting |v3|.
+ GestureEventForTest g1_up(ui::ET_GESTURE_TAP_UP, 110, 110, 0);
+ root->OnGestureEvent(g1_up);
+
v1->Reset();
v2->Reset();
v3->Reset();
@@ -613,6 +617,15 @@ TEST_F(ViewTest, GestureEvent) {
EXPECT_EQ(gfx::Point(80, 80), v1->location_);
EXPECT_EQ(ui::ET_UNKNOWN, v2->last_gesture_event_type_);
+ // Send event |g1| again. Even though the coordinates target |v3| it should go
+ // to |v1| as that is the view the touch was initially down on.
+ v1->last_gesture_event_type_ = ui::ET_UNKNOWN;
+ v3->last_gesture_event_type_ = ui::ET_UNKNOWN;
+ root->OnGestureEvent(g1);
+ EXPECT_EQ(ui::ET_GESTURE_TAP, v1->last_gesture_event_type_);
+ EXPECT_EQ(ui::ET_UNKNOWN, v3->last_gesture_event_type_);
+ EXPECT_EQ("110,110", v1->location_.ToString());
+
widget->CloseNow();
}
« no previous file with comments | « ui/views/view.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698