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

Unified Diff: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc

Issue 607623002: Add unittests for null/empty window shapes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ShapedAppWindowTargeterTest Created 6 years, 3 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/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
diff --git a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
index 05c6ae439de748aeed5eeec2db4bc975cb06fce8..0da22577bfd783ca7eb69da2ac81479658add0f7 100644
--- a/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
+++ b/chrome/browser/ui/views/apps/shaped_app_window_targeter_unittest.cc
@@ -94,6 +94,28 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
ASSERT_FALSE(details.dispatcher_destroyed);
EXPECT_EQ(window, move2.target());
}
+
+ region.reset(new SkRegion);
+ region->op(SkIRect::MakeXYWH(0, 0, 0, 0), SkRegion::kUnion_Op);
+ app_window()->UpdateShape(region.Pass());
+ {
+ // With an empty custom shape, all events within the window should fall
+ // through to the root window.
+ ui::MouseEvent move(ui::ET_MOUSE_MOVED,
tapted 2014/09/29 01:16:20 This is super-nitty, but I kinda feel this would b
garykac 2014/09/29 23:50:59 Moved.
+ gfx::Point(40, 40), gfx::Point(40, 40),
+ ui::EF_NONE, ui::EF_NONE);
+ ui::EventDispatchDetails details =
+ event_processor()->OnEventFromSource(&move);
+ ASSERT_FALSE(details.dispatcher_destroyed);
+ EXPECT_EQ(root_window(), move.target());
+
+ ui::MouseEvent move2(ui::ET_MOUSE_MOVED,
+ gfx::Point(80, 80), gfx::Point(80, 80),
+ ui::EF_NONE, ui::EF_NONE);
+ details = event_processor()->OnEventFromSource(&move2);
+ ASSERT_FALSE(details.dispatcher_destroyed);
+ EXPECT_EQ(root_window(), move2.target());
+ }
}
TEST_F(ShapedAppWindowTargeterTest, HitTestOnlyForShapedWindow) {
« no previous file with comments | « no previous file | ui/views/widget/desktop_aura/x11_topmost_window_finder_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698