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

Unified Diff: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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
Index: ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
index 8a66c6e032717e46a21ab5390aaa305c76b6565a..2e9188a6b3df0582fa90fb41b67842bae6fdb933 100644
--- a/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
+++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_x11_unittest.cc
@@ -307,6 +307,17 @@ TEST_F(DesktopWindowTreeHostX11Test, Shape) {
EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 15, 5));
EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 95, 15));
EXPECT_FALSE(ShapeRectContainsPoint(shape_rects, 105, 15));
+
+ // Setting the shape to NULL resets the shape back to the entire
+ // window bounds.
+ widget2->SetShape(NULL);
+ shape_rects = GetShapeRects(xid2);
+ ASSERT_FALSE(shape_rects.empty());
+ EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 5, 5));
+ EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 15, 5));
+ EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 95, 15));
+ EXPECT_TRUE(ShapeRectContainsPoint(shape_rects, 105, 15));
+ EXPECT_FALSE(ShapeRectContainsPoint(shape_rects, 500, 500));
}
// Test that the widget ignores changes in fullscreen state initiated by the

Powered by Google App Engine
This is Rietveld 408576698