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

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: Window now gets visibility from Layer. 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
Index: ui/aura/window_unittest.cc
diff --git a/ui/aura/window_unittest.cc b/ui/aura/window_unittest.cc
index 48834c5fef13614203b39bdb1f00531a31b008a3..668e7856be64295fb69a7e800dbe50ba947a1840 100644
--- a/ui/aura/window_unittest.cc
+++ b/ui/aura/window_unittest.cc
@@ -594,5 +594,42 @@ 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());
+}
+
} // namespace internal
} // namespace aura
« ui/aura/window.cc ('K') | « ui/aura/window.cc ('k') | ui/gfx/compositor/layer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698