Chromium Code Reviews| 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..55f7cc811166a4b9ed200317020ca024864aa666 100644 |
| --- a/ash/wm/system_modal_container_layout_manager_unittest.cc |
| +++ b/ash/wm/system_modal_container_layout_manager_unittest.cc |
| @@ -676,6 +676,31 @@ TEST_F(SystemModalContainerLayoutManagerTest, UpdateModalType) { |
| EXPECT_FALSE(WmShell::Get()->IsSystemModalWindowOpen()); |
| } |
| +TEST_F(SystemModalContainerLayoutManagerTest, VisibilityChange) { |
| + // Create a modal window. |
| + std::unique_ptr<aura::Window> parent(OpenToplevelTestWindow(false)); |
| + std::unique_ptr<aura::Window> modal_window( |
| + OpenTestWindowWithParent(parent.get(), true)); |
| + parent->Show(); |
| + modal_window->Show(); |
|
James Cook
2016/06/27 00:33:43
optional: Maybe test it prior to modal_window->Sho
oshima
2016/06/27 02:26:07
Done. (turns out the function was calling show, so
|
| + EXPECT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
| + EXPECT_TRUE(Shell::GetPrimaryRootWindowController() |
|
James Cook
2016/06/27 00:33:43
optional nit: Cache pointer to SystemModalLayoutMa
oshima
2016/06/27 02:26:07
Done.
|
| + ->GetSystemModalLayoutManager(modal_window.get()) |
| + ->has_modal_background()); |
| + |
| + modal_window->Hide(); |
| + EXPECT_FALSE(WmShell::Get()->IsSystemModalWindowOpen()); |
| + EXPECT_FALSE(Shell::GetPrimaryRootWindowController() |
| + ->GetSystemModalLayoutManager(modal_window.get()) |
| + ->has_modal_background()); |
| + |
| + modal_window->Show(); |
| + EXPECT_TRUE(WmShell::Get()->IsSystemModalWindowOpen()); |
| + EXPECT_TRUE(Shell::GetPrimaryRootWindowController() |
| + ->GetSystemModalLayoutManager(modal_window.get()) |
| + ->has_modal_background()); |
| +} |
| + |
| namespace { |
| class InputTestDelegate : public aura::test::TestWindowDelegate { |