| 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/wm/system_modal_container_layout_manager.h" | 5 #include "ash/wm/system_modal_container_layout_manager.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/session_state_delegate.h" | 8 #include "ash/session_state_delegate.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 EXPECT_TRUE(AllRootWindowsHaveModalBackgrounds()); | 430 EXPECT_TRUE(AllRootWindowsHaveModalBackgrounds()); |
| 431 EXPECT_FALSE(AllRootWindowsHaveLockedModalBackgrounds()); | 431 EXPECT_FALSE(AllRootWindowsHaveLockedModalBackgrounds()); |
| 432 TestWindow::CloseTestWindow(modal_window2.release()); | 432 TestWindow::CloseTestWindow(modal_window2.release()); |
| 433 | 433 |
| 434 // Here we should check the behavior of the locked system modal dialog when | 434 // Here we should check the behavior of the locked system modal dialog when |
| 435 // unlocked, but such case isn't handled very well right now. | 435 // unlocked, but such case isn't handled very well right now. |
| 436 // See crbug.com/157660 | 436 // See crbug.com/157660 |
| 437 // TODO(mukai): add the test case when the bug is fixed. | 437 // TODO(mukai): add the test case when the bug is fixed. |
| 438 } | 438 } |
| 439 | 439 |
| 440 #if defined(OS_WIN) | 440 TEST_F(SystemModalContainerLayoutManagerTest, MultiDisplays) { |
| 441 // Multiple displays are not supported on Windows Ash. http://crbug.com/165962 | 441 if (!SupportsMultipleDisplays()) |
| 442 #define MAYBE_MultiDisplays DISABLED_MultiDisplays | 442 return; |
| 443 #else | |
| 444 #define MAYBE_MultiDisplays MultiDisplays | |
| 445 #endif | |
| 446 | 443 |
| 447 TEST_F(SystemModalContainerLayoutManagerTest, MAYBE_MultiDisplays) { | |
| 448 UpdateDisplay("500x500,500x500"); | 444 UpdateDisplay("500x500,500x500"); |
| 449 | 445 |
| 450 scoped_ptr<aura::Window> normal(OpenToplevelTestWindow(false)); | 446 scoped_ptr<aura::Window> normal(OpenToplevelTestWindow(false)); |
| 451 normal->SetBounds(gfx::Rect(100, 100, 50, 50)); | 447 normal->SetBounds(gfx::Rect(100, 100, 50, 50)); |
| 452 | 448 |
| 453 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 449 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 454 EXPECT_EQ(2U, root_windows.size()); | 450 EXPECT_EQ(2U, root_windows.size()); |
| 455 aura::Window* container1 = Shell::GetContainer( | 451 aura::Window* container1 = Shell::GetContainer( |
| 456 root_windows[0], ash::internal::kShellWindowId_SystemModalContainer); | 452 root_windows[0], ash::internal::kShellWindowId_SystemModalContainer); |
| 457 aura::Window* container2 = Shell::GetContainer( | 453 aura::Window* container2 = Shell::GetContainer( |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 489 |
| 494 // No more modal screen. | 490 // No more modal screen. |
| 495 modal1->Hide(); | 491 modal1->Hide(); |
| 496 TestWindow::CloseTestWindow(modal1.release()); | 492 TestWindow::CloseTestWindow(modal1.release()); |
| 497 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds()); | 493 EXPECT_FALSE(AllRootWindowsHaveModalBackgrounds()); |
| 498 EXPECT_TRUE(wm::IsActiveWindow(normal.get())); | 494 EXPECT_TRUE(wm::IsActiveWindow(normal.get())); |
| 499 } | 495 } |
| 500 | 496 |
| 501 } // namespace test | 497 } // namespace test |
| 502 } // namespace ash | 498 } // namespace ash |
| OLD | NEW |