| 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 24 matching lines...) Expand all Loading... |
| 35 namespace { | 35 namespace { |
| 36 | 36 |
| 37 std::unique_ptr<Browser> CreateTestBrowser(aura::Window* window, | 37 std::unique_ptr<Browser> CreateTestBrowser(aura::Window* window, |
| 38 const gfx::Rect& bounds, | 38 const gfx::Rect& bounds, |
| 39 Browser::CreateParams* params) { | 39 Browser::CreateParams* params) { |
| 40 if (!bounds.IsEmpty()) | 40 if (!bounds.IsEmpty()) |
| 41 window->SetBounds(bounds); | 41 window->SetBounds(bounds); |
| 42 std::unique_ptr<Browser> browser = | 42 std::unique_ptr<Browser> browser = |
| 43 chrome::CreateBrowserWithAuraTestWindowForParams(base::WrapUnique(window), | 43 chrome::CreateBrowserWithAuraTestWindowForParams(base::WrapUnique(window), |
| 44 params); | 44 params); |
| 45 if (browser->is_type_tabbed() || browser->is_app()) { | 45 if (!browser->is_type_popup()) { |
| 46 ash::wm::GetWindowState(browser->window()->GetNativeWindow()) | 46 ash::wm::GetWindowState(browser->window()->GetNativeWindow()) |
| 47 ->set_window_position_managed(true); | 47 ->set_window_position_managed(true); |
| 48 } | 48 } |
| 49 return browser; | 49 return browser; |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 // Test that the window is sized appropriately for the first run experience | 54 // Test that the window is sized appropriately for the first run experience |
| 55 // where the default window bounds calculation is invoked. | 55 // where the default window bounds calculation is invoked. |
| (...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 EXPECT_EQ( | 861 EXPECT_EQ( |
| 862 ui::SHOW_STATE_DEFAULT, | 862 ui::SHOW_STATE_DEFAULT, |
| 863 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 863 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
| 864 trusted_popup.get(), p1280x1024, p1600x1200)); | 864 trusted_popup.get(), p1280x1024, p1600x1200)); |
| 865 // A popup that is sized to occupy the whole work area has default state. | 865 // A popup that is sized to occupy the whole work area has default state. |
| 866 EXPECT_EQ( | 866 EXPECT_EQ( |
| 867 ui::SHOW_STATE_DEFAULT, | 867 ui::SHOW_STATE_DEFAULT, |
| 868 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, | 868 GetWindowShowState(ui::SHOW_STATE_DEFAULT, ui::SHOW_STATE_NORMAL, BOTH, |
| 869 trusted_popup.get(), p1600x1200, p1600x1200)); | 869 trusted_popup.get(), p1600x1200, p1600x1200)); |
| 870 } | 870 } |
| OLD | NEW |