| 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/scoped_root_window_for_new_windows.h" | 5 #include "ash/common/scoped_root_window_for_new_windows.h" |
| 6 #include "ash/common/wm/window_positioner.h" | 6 #include "ash/common/wm/window_positioner.h" |
| 7 #include "ash/common/wm/window_resizer.h" | 7 #include "ash/common/wm/window_resizer.h" |
| 8 #include "ash/common/wm/window_state.h" | 8 #include "ash/common/wm/window_state.h" |
| 9 #include "ash/common/wm_shell.h" | 9 #include "ash/common/wm_shell.h" |
| 10 #include "ash/common/wm_window.h" | 10 #include "ash/common/wm_window.h" |
| (...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 // the non browser window. This differ from PersistedBoundsCase | 817 // the non browser window. This differ from PersistedBoundsCase |
| 818 // in that this uses real ash shell implementations + StateProvider | 818 // in that this uses real ash shell implementations + StateProvider |
| 819 // TargetDisplayProvider, rather than mocks. | 819 // TargetDisplayProvider, rather than mocks. |
| 820 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) { | 820 TEST_F(WindowSizerAshTest, DefaultBoundsInTargetDisplay) { |
| 821 if (!ash_util::ShouldOpenAshOnStartup()) | 821 if (!ash_util::ShouldOpenAshOnStartup()) |
| 822 return; | 822 return; |
| 823 UpdateDisplay("500x500,600x600"); | 823 UpdateDisplay("500x500,600x600"); |
| 824 | 824 |
| 825 // By default windows are placed on the primary display. | 825 // By default windows are placed on the primary display. |
| 826 ash::WmWindow* first_root = ash::WmShell::Get()->GetAllRootWindows()[0]; | 826 ash::WmWindow* first_root = ash::WmShell::Get()->GetAllRootWindows()[0]; |
| 827 EXPECT_EQ(first_root, ash::WmShell::Get()->GetRootWindowForNewWindows()); | 827 EXPECT_EQ(first_root, |
| 828 ash::Shell::GetInstance()->GetRootWindowForNewWindows()); |
| 828 gfx::Rect bounds; | 829 gfx::Rect bounds; |
| 829 ui::WindowShowState show_state; | 830 ui::WindowShowState show_state; |
| 830 WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(), gfx::Rect(), | 831 WindowSizer::GetBrowserWindowBoundsAndShowState(std::string(), gfx::Rect(), |
| 831 NULL, &bounds, &show_state); | 832 NULL, &bounds, &show_state); |
| 832 EXPECT_TRUE(first_root->GetBoundsInScreen().Contains(bounds)); | 833 EXPECT_TRUE(first_root->GetBoundsInScreen().Contains(bounds)); |
| 833 | 834 |
| 834 { | 835 { |
| 835 // When the second display is active new windows are placed there. | 836 // When the second display is active new windows are placed there. |
| 836 ash::WmWindow* second_root = ash::WmShell::Get()->GetAllRootWindows()[1]; | 837 ash::WmWindow* second_root = ash::WmShell::Get()->GetAllRootWindows()[1]; |
| 837 ash::ScopedRootWindowForNewWindows tmp(second_root); | 838 ash::ScopedRootWindowForNewWindows tmp(second_root); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 861 EXPECT_EQ( | 862 EXPECT_EQ( |
| 862 ui::SHOW_STATE_DEFAULT, | 863 ui::SHOW_STATE_DEFAULT, |
| 863 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 864 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
| 864 trusted_popup.get(), p1280x1024, p1600x1200)); | 865 trusted_popup.get(), p1280x1024, p1600x1200)); |
| 865 // A popup that is sized to occupy the whole work area has default state. | 866 // A popup that is sized to occupy the whole work area has default state. |
| 866 EXPECT_EQ( | 867 EXPECT_EQ( |
| 867 ui::SHOW_STATE_DEFAULT, | 868 ui::SHOW_STATE_DEFAULT, |
| 868 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 869 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
| 869 trusted_popup.get(), p1600x1200, p1600x1200)); | 870 trusted_popup.get(), p1600x1200, p1600x1200)); |
| 870 } | 871 } |
| OLD | NEW |