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

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: Update ASCII art 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..ecfbf13f8513ce63dc6fa4a866777ff5e9ffed41 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
@@ -72,6 +72,30 @@ TEST_F(ShapedAppWindowTargeterTest, HitTestBasic) {
}
scoped_ptr<SkRegion> region(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,
+ 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());
+ }
+
+ // Window shape (global coordinates)
+ // 30 70 90 130
+ // 30 + +-----+
+ // . | | <- mouse move (40,40)
+ // 70 +--------+ +---------+
+ // | . | <- mouse move (80,80)
+ // 90 +--------+ +---------+
+ // | |
+ // 130 +-----+
+ region.reset(new SkRegion);
region->op(SkIRect::MakeXYWH(40, 0, 20, 100), SkRegion::kUnion_Op);
region->op(SkIRect::MakeXYWH(0, 40, 100, 20), SkRegion::kUnion_Op);
app_window()->UpdateShape(region.Pass());
« 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