| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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_, true); | 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_ = base::MakeUnique<WindowPositioner>(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 void WindowPositionerTest::TearDown() { | 85 void WindowPositionerTest::TearDown() { |
| 86 // Since the AuraTestBase is needed to create our assets, we have to | 86 // Since the AuraTestBase is needed to create our assets, we have to |
| 87 // also delete them before we tear it down. | 87 // also delete them before we tear it down. |
| 88 browser_.reset(); | 88 browser_.reset(); |
| 89 browser_popup_.reset(); | 89 browser_popup_.reset(); |
| 90 window_positioner_.reset(); | 90 window_positioner_.reset(); |
| 91 AshTestBase::TearDown(); | 91 AshTestBase::TearDown(); |
| 92 } | 92 } |
| (...skipping 128 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 |