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

Unified Diff: ui/aura/window_unittest.cc

Issue 8136005: Makes visbility inherited. That is, in order for a window to be (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to trunk Created 9 years, 2 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/aura_shell/examples/window_type_launcher.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 fa6813fabf4442f8315c4fe9bbb50028ad28930c..d1c0ac5614e0a5bec10232209f8421ebace8278b 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -594,6 +594,43 @@ TEST_F(WindowTest, GetEventHandlerForPoint_NoDelegate) {
EXPECT_EQ(w111.get(), w1->GetEventHandlerForPoint(target_point));
}
+// Verifies show/hide propagate correctly to children and the layer.
+TEST_F(WindowTest, Visibility) {
+ scoped_ptr<Window> w1(CreateTestWindowWithId(1, NULL));
+ scoped_ptr<Window> w2(CreateTestWindowWithId(2, w1.get()));
+ scoped_ptr<Window> w3(CreateTestWindowWithId(3, w2.get()));
+
+ // Create shows all the windows.
+ EXPECT_TRUE(w1->IsVisible());
+ EXPECT_TRUE(w2->IsVisible());
+ EXPECT_TRUE(w3->IsVisible());
+
+ w1->Hide();
+ EXPECT_FALSE(w1->IsVisible());
+ EXPECT_FALSE(w2->IsVisible());
+ EXPECT_FALSE(w3->IsVisible());
+
+ w2->Show();
+ EXPECT_FALSE(w1->IsVisible());
+ EXPECT_FALSE(w2->IsVisible());
+ EXPECT_FALSE(w3->IsVisible());
+
+ w3->Hide();
+ EXPECT_FALSE(w1->IsVisible());
+ EXPECT_FALSE(w2->IsVisible());
+ EXPECT_FALSE(w3->IsVisible());
+
+ w1->Show();
+ EXPECT_TRUE(w1->IsVisible());
+ EXPECT_TRUE(w2->IsVisible());
+ EXPECT_FALSE(w3->IsVisible());
+
+ w3->Show();
+ EXPECT_TRUE(w1->IsVisible());
+ EXPECT_TRUE(w2->IsVisible());
+ EXPECT_TRUE(w3->IsVisible());
+}
+
// When set_consume_events() is called with |true| for a Window, that Window
// should make sure that none behind it in the z-order see events if it has
// children. If it does not have children, event targeting works as usual.
« no previous file with comments | « ui/aura/window.cc ('k') | ui/aura_shell/examples/window_type_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698