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

Unified Diff: ash/wm/system_modal_container_layout_manager_unittest.cc

Issue 2098183002: Make system modal check more strict (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed cut Created 4 years, 6 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 | « ash/wm/system_modal_container_layout_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/system_modal_container_layout_manager_unittest.cc
diff --git a/ash/wm/system_modal_container_layout_manager_unittest.cc b/ash/wm/system_modal_container_layout_manager_unittest.cc
index c8c5b4890ec198e4df37e2fd733b318f891e3168..77ac061599da3eb7119488e3c75de18af3802fef 100644
--- a/ash/wm/system_modal_container_layout_manager_unittest.cc
+++ b/ash/wm/system_modal_container_layout_manager_unittest.cc
@@ -676,6 +676,32 @@ TEST_F(SystemModalContainerLayoutManagerTest, UpdateModalType) {
EXPECT_FALSE(WmShell::Get()->IsSystemModalWindowOpen());
}
+TEST_F(SystemModalContainerLayoutManagerTest, VisibilityChange) {
+ std::unique_ptr<aura::Window> window(OpenToplevelTestWindow(false));
+ std::unique_ptr<aura::Window> modal_window(
+ views::Widget::CreateWindowWithContext(new TestWindow(true),
+ CurrentContext())
+ ->GetNativeWindow());
+ SystemModalContainerLayoutManager* layout_manager =
+ Shell::GetPrimaryRootWindowController()->GetSystemModalLayoutManager(
+ modal_window.get());
+
+ EXPECT_FALSE(WmShell::Get()->IsSystemModalWindowOpen());
+ EXPECT_FALSE(layout_manager->has_modal_background());
+
+ modal_window->Show();
+ EXPECT_TRUE(WmShell::Get()->IsSystemModalWindowOpen());
+ EXPECT_TRUE(layout_manager->has_modal_background());
+
+ modal_window->Hide();
+ EXPECT_FALSE(WmShell::Get()->IsSystemModalWindowOpen());
+ EXPECT_FALSE(layout_manager->has_modal_background());
+
+ modal_window->Show();
+ EXPECT_TRUE(WmShell::Get()->IsSystemModalWindowOpen());
+ EXPECT_TRUE(layout_manager->has_modal_background());
+}
+
namespace {
class InputTestDelegate : public aura::test::TestWindowDelegate {
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698