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/window_positioner.h" | 5 #include "ash/common/wm/window_positioner.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/wm/window_resizer.h" | 9 #include "ash/common/wm/window_resizer.h" |
10 #include "ash/common/wm_shell.h" | 10 #include "ash/common/wm_shell.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void WindowPositionerTest::SetUp() { | 60 void WindowPositionerTest::SetUp() { |
61 AshTestBase::SetUp(); | 61 AshTestBase::SetUp(); |
62 // Create some default dummy windows. | 62 // Create some default dummy windows. |
63 std::unique_ptr<aura::Window> dummy_window(CreateTestWindowInShellWithId(0)); | 63 std::unique_ptr<aura::Window> dummy_window(CreateTestWindowInShellWithId(0)); |
64 dummy_window->SetBounds(gfx::Rect(16, 32, 640, 320)); | 64 dummy_window->SetBounds(gfx::Rect(16, 32, 640, 320)); |
65 std::unique_ptr<aura::Window> dummy_popup(CreateTestWindowInShellWithId(1)); | 65 std::unique_ptr<aura::Window> dummy_popup(CreateTestWindowInShellWithId(1)); |
66 dummy_popup->SetBounds(gfx::Rect(16, 32, 128, 256)); | 66 dummy_popup->SetBounds(gfx::Rect(16, 32, 128, 256)); |
67 | 67 |
68 // Create a browser for the window. | 68 // Create a browser for the window. |
69 Browser::CreateParams window_params(&profile_); | 69 Browser::CreateParams window_params(&profile_, true); |
70 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 70 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
71 std::move(dummy_window), &window_params); | 71 std::move(dummy_window), &window_params); |
72 | 72 |
73 // Creating a browser for the popup. | 73 // Creating a browser for the popup. |
74 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_); | 74 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_, true); |
75 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 75 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
76 std::move(dummy_popup), &popup_params); | 76 std::move(dummy_popup), &popup_params); |
77 | 77 |
78 // We hide all windows upon start - each user is required to set it up | 78 // We hide all windows upon start - each user is required to set it up |
79 // as they need it. | 79 // as they need it. |
80 window()->Hide(); | 80 window()->Hide(); |
81 popup()->Hide(); | 81 popup()->Hide(); |
82 window_positioner_.reset(new WindowPositioner(WmShell::Get())); | 82 window_positioner_.reset(new WindowPositioner(WmShell::Get())); |
83 } | 83 } |
84 | 84 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 // Check that the popup is placed full screen. | 222 // Check that the popup is placed full screen. |
223 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 223 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
224 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 224 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
225 pop_position.width(), pop_position.height()), | 225 pop_position.width(), pop_position.height()), |
226 full); | 226 full); |
227 } | 227 } |
228 | 228 |
229 } // namespace test | 229 } // namespace test |
230 } // namespace ash | 230 } // namespace ash |
OLD | NEW |