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

Unified Diff: ui/views/controls/native/native_view_host_aura_unittest.cc

Issue 517143003: Hide NativeViewHostAura correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test 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/controls/native/native_view_host_aura_unittest.cc
diff --git a/ui/views/controls/native/native_view_host_aura_unittest.cc b/ui/views/controls/native/native_view_host_aura_unittest.cc
index 54212cdc99d5d783dfec4a4e3dd5a2339fba600b..93e0fe2c8642b31321436172853c7015417c3c82 100644
--- a/ui/views/controls/native/native_view_host_aura_unittest.cc
+++ b/ui/views/controls/native/native_view_host_aura_unittest.cc
@@ -374,4 +374,24 @@ TEST_F(NativeViewHostAuraTest, Attach) {
DestroyHost();
}
+// Ensure the clipping window is hidden with the native view. This is a
+// regression test for https://crbug.com/408877.
+TEST_F(NativeViewHostAuraTest, SimpleShowAndHide) {
+ CreateHost();
+
+ toplevel()->SetBounds(gfx::Rect(20, 20, 100, 100));
+ toplevel()->Show();
+
+ host()->SetBounds(10, 10, 80, 80);
+ EXPECT_TRUE(clipping_window()->IsVisible());
+ EXPECT_TRUE(child()->IsVisible());
+
+ host()->SetVisible(false);
+ EXPECT_FALSE(clipping_window()->IsVisible());
+ EXPECT_FALSE(child()->IsVisible());
+
+ DestroyHost();
+ DestroyTopLevel();
+}
+
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698