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

Unified Diff: ui/aura/window_unittest.cc

Issue 10854060: ash: Use different hit-test outer-region for mouse and touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: scale 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/aura/window.cc ('k') | ui/oak/oak_aura_window_display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index af8a4700602fdd3ec00ccea1f82864df25b19204..a26c0d5514d5528a9b1a2a801812c10e8fd08b5c 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -429,10 +429,21 @@ TEST_F(WindowTest, HitTest) {
EXPECT_FALSE(w1.HitTest(gfx::Point(-1, -1)));
// We can expand the bounds slightly to track events outside our border.
- w1.set_hit_test_bounds_override_outer(gfx::Insets(-1, -1, -1, -1));
+ w1.SetHitTestBoundsOverrideOuter(gfx::Insets(-1, -1, -1, -1), 5);
EXPECT_TRUE(w1.HitTest(gfx::Point(-1, -1)));
EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2)));
+ ui::TouchEventImpl pressed(
+ ui::ET_TOUCH_PRESSED, gfx::Point(50, 50), 0, getTime());
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&pressed);
+ EXPECT_TRUE(w1.HitTest(gfx::Point(-2, -2)));
+ EXPECT_TRUE(w1.HitTest(gfx::Point(-5, -5)));
+ EXPECT_FALSE(w1.HitTest(gfx::Point(-5, -6)));
+ ui::TouchEventImpl released(
+ ui::ET_TOUCH_RELEASED, gfx::Point(50, 50), 0, getTime());
+ root_window()->AsRootWindowHostDelegate()->OnHostTouchEvent(&released);
+ EXPECT_FALSE(w1.HitTest(gfx::Point(-2, -2)));
+
// TODO(beng): clip Window to parent.
}
« no previous file with comments | « ui/aura/window.cc ('k') | ui/oak/oak_aura_window_display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698