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

Unified Diff: ui/wm/core/transient_window_manager_unittest.cc

Issue 628413002: Show transient child when the transient parent is shown (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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/wm/core/transient_window_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/transient_window_manager_unittest.cc
diff --git a/ui/wm/core/transient_window_manager_unittest.cc b/ui/wm/core/transient_window_manager_unittest.cc
index 05b8e88e4debf5781a3f31bb8d93b579a4a8edff..eaac027da78c07ca5826120c759dbabc6b6ad391 100644
--- a/ui/wm/core/transient_window_manager_unittest.cc
+++ b/ui/wm/core/transient_window_manager_unittest.cc
@@ -116,6 +116,47 @@ TEST_F(TransientWindowManagerTest, TransientChildren) {
EXPECT_TRUE(w2->IsVisible());
w1->Hide();
EXPECT_FALSE(w2->IsVisible());
+
+ // And they should stay hidden even after the parent became visible.
+ w1->Show();
+ EXPECT_FALSE(w2->IsVisible());
+
+ // Hidden transient child should stay hidden regardless of
+ // parent's visibility.
+ w2->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_FALSE(w2->IsVisible());
+
+ // Transient child can be shown even if the transient parent is hidden.
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Show();
+ EXPECT_TRUE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
+
+ // When the parent_controls_visibility is true, TransientWindowManager
+ // controls the children's visibility. It stays invisible even if
+ // Window::Show() is called, and gets shown when the parent becomes visible.
+ wm::TransientWindowManager::Get(w2)->set_parent_controls_visibility(true);
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Show();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
+
+ // Hiding a transient child that is hidden by the transient parent
+ // is not currently handled and will be shown anyway.
+ w1->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w2->Hide();
+ EXPECT_FALSE(w2->IsVisible());
+ w1->Show();
+ EXPECT_TRUE(w2->IsVisible());
}
// Tests that transient children are stacked as a unit when using stack above.
« no previous file with comments | « ui/wm/core/transient_window_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698