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

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

Issue 132363004: Revert 243974 "Target touches to the correct display." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 11 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 | trunk/src/ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/aura/gestures/gesture_recognizer_unittest.cc
===================================================================
--- trunk/src/ui/aura/gestures/gesture_recognizer_unittest.cc (revision 244019)
+++ trunk/src/ui/aura/gestures/gesture_recognizer_unittest.cc (working copy)
@@ -2169,13 +2169,13 @@
// Touches should now be associated with the closest touch within
// ui::GestureConfiguration::max_separation_for_gesture_touches_in_pixels
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 11), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 11));
EXPECT_EQ("0", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 11), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 11));
EXPECT_EQ("1", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 511), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(11, 511));
EXPECT_EQ("2", WindowIDAsString(target));
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 511), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(511, 511));
EXPECT_EQ("3", WindowIDAsString(target));
// Add a touch in the middle associated with windows[2]
@@ -2186,20 +2186,20 @@
kNumWindows, tes.Now());
dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move);
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(250, 250));
EXPECT_EQ("2", WindowIDAsString(target));
// Make sure that ties are broken by distance to a current touch
// Closer to the point in the bottom right.
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(380, 380), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(380, 380));
EXPECT_EQ("3", WindowIDAsString(target));
// This touch is closer to the point in the middle
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(300, 300), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(300, 300));
EXPECT_EQ("2", WindowIDAsString(target));
// A touch too far from other touches won't be locked to anything
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000));
EXPECT_TRUE(target == NULL);
// Move a touch associated with windows[2] to 1000, 1000
@@ -2207,7 +2207,7 @@
kNumWindows, tes.Now());
dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&move2);
- target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000), -1);
+ target = gesture_recognizer->GetTargetForLocation(gfx::Point(1000, 1000));
EXPECT_EQ("2", WindowIDAsString(target));
for (int i = 0; i < kNumWindows; ++i) {
@@ -2217,36 +2217,6 @@
}
}
-// Check that a touch's target will not be effected by a touch on a different
-// screen.
-TEST_F(GestureRecognizerTest, GestureEventTouchLockIgnoresOtherScreens) {
- scoped_ptr<GestureEventConsumeDelegate> delegate(
- new GestureEventConsumeDelegate());
- gfx::Rect bounds(0, 0, 10, 10);
- scoped_ptr<aura::Window> window(
- CreateTestWindowWithDelegate(delegate.get(), 0, bounds, root_window()));
-
- const int kTouchId1 = 8;
- const int kTouchId2 = 2;
- TimedEvents tes;
-
- ui::TouchEvent press1(ui::ET_TOUCH_PRESSED, gfx::Point(5, 5),
- kTouchId1, tes.Now());
- press1.set_source_device_id(1);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press1);
-
- ui::TouchEvent press2(ui::ET_TOUCH_PRESSED, gfx::Point(20, 20),
- kTouchId2, tes.Now());
- press2.set_source_device_id(2);
- dispatcher()->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press2);
-
- // The second press should not have been locked to the same target as the
- // first, as they occured on different displays.
- EXPECT_NE(
- ui::GestureRecognizer::Get()->GetTouchLockedTarget(press1),
- ui::GestureRecognizer::Get()->GetTouchLockedTarget(press2));
-}
-
// Check that touch events outside the root window are still handled
// by the root window's gesture sequence.
TEST_F(GestureRecognizerTest, GestureEventOutsideRootWindowTap) {
« no previous file with comments | « no previous file | trunk/src/ui/aura/test/aura_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698