| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/common/wm/system_modal_container_layout_manager.h" | 5 #include "ash/common/wm/system_modal_container_layout_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/wm/container_finder.h" | 10 #include "ash/common/wm/container_finder.h" |
| (...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 TestWindow::CloseTestWindow(modal_window.release()); | 577 TestWindow::CloseTestWindow(modal_window.release()); |
| 578 UnblockUserSession(); | 578 UnblockUserSession(); |
| 579 // Here we should check the behavior of the locked system modal dialog when | 579 // Here we should check the behavior of the locked system modal dialog when |
| 580 // unlocked, but such case isn't handled very well right now. | 580 // unlocked, but such case isn't handled very well right now. |
| 581 // See crbug.com/157660 | 581 // See crbug.com/157660 |
| 582 // TODO(mukai): add the test case when the bug is fixed. | 582 // TODO(mukai): add the test case when the bug is fixed. |
| 583 } | 583 } |
| 584 } | 584 } |
| 585 | 585 |
| 586 TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) { | 586 TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) { |
| 587 if (!SupportsMultipleDisplays()) | |
| 588 return; | |
| 589 | |
| 590 UpdateDisplay("500x500,500x500"); | 587 UpdateDisplay("500x500,500x500"); |
| 591 | 588 |
| 592 std::unique_ptr<aura::Window> normal(OpenToplevelTestWindow(false)); | 589 std::unique_ptr<aura::Window> normal(OpenToplevelTestWindow(false)); |
| 593 normal->SetBounds(gfx::Rect(100, 100, 50, 50)); | 590 normal->SetBounds(gfx::Rect(100, 100, 50, 50)); |
| 594 | 591 |
| 595 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 592 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
| 596 EXPECT_EQ(2U, root_windows.size()); | 593 EXPECT_EQ(2U, root_windows.size()); |
| 597 aura::Window* container1 = Shell::GetContainer( | 594 aura::Window* container1 = Shell::GetContainer( |
| 598 root_windows[0], ash::kShellWindowId_SystemModalContainer); | 595 root_windows[0], ash::kShellWindowId_SystemModalContainer); |
| 599 aura::Window* container2 = Shell::GetContainer( | 596 aura::Window* container2 = Shell::GetContainer( |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 886 | 883 |
| 887 } // namespace | 884 } // namespace |
| 888 | 885 |
| 889 TEST_F(SystemModalContainerLayoutManagerTest, BlockAllEvents) { | 886 TEST_F(SystemModalContainerLayoutManagerTest, BlockAllEvents) { |
| 890 InputTestDelegate delegate; | 887 InputTestDelegate delegate; |
| 891 delegate.RunTest(this); | 888 delegate.RunTest(this); |
| 892 } | 889 } |
| 893 | 890 |
| 894 // Make sure that events are properly blocked in multi displays environment. | 891 // Make sure that events are properly blocked in multi displays environment. |
| 895 TEST_F(SystemModalContainerLayoutManagerTest, BlockEventsInMultiDisplays) { | 892 TEST_F(SystemModalContainerLayoutManagerTest, BlockEventsInMultiDisplays) { |
| 896 if (!SupportsMultipleDisplays()) | |
| 897 return; | |
| 898 | |
| 899 UpdateDisplay("500x500, 500x500"); | 893 UpdateDisplay("500x500, 500x500"); |
| 900 InputTestDelegate delegate; | 894 InputTestDelegate delegate; |
| 901 delegate.RunTest(this); | 895 delegate.RunTest(this); |
| 902 } | 896 } |
| 903 | 897 |
| 904 } // namespace test | 898 } // namespace test |
| 905 } // namespace ash | 899 } // namespace ash |
| OLD | NEW |