| 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/common/window_positioner.h" | 5 #include "ash/wm/common/window_positioner.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "ash/test/ash_test_base.h" | 9 #include "ash/test/ash_test_base.h" |
| 10 #include "ash/test/test_shell_delegate.h" | 10 #include "ash/test/test_shell_delegate.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 // Creating a browser for the popup. | 75 // Creating a browser for the popup. |
| 76 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_); | 76 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_); |
| 77 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 77 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
| 78 std::move(dummy_popup), &popup_params); | 78 std::move(dummy_popup), &popup_params); |
| 79 | 79 |
| 80 // We hide all windows upon start - each user is required to set it up | 80 // We hide all windows upon start - each user is required to set it up |
| 81 // as he needs it. | 81 // as he needs it. |
| 82 window()->Hide(); | 82 window()->Hide(); |
| 83 popup()->Hide(); | 83 popup()->Hide(); |
| 84 window_positioner_.reset(new WindowPositioner(wm::WmGlobalsAura::Get())); | 84 window_positioner_.reset(new WindowPositioner(wm::WmGlobals::Get())); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void WindowPositionerTest::TearDown() { | 87 void WindowPositionerTest::TearDown() { |
| 88 // Since the AuraTestBase is needed to create our assets, we have to | 88 // Since the AuraTestBase is needed to create our assets, we have to |
| 89 // also delete them before we tear it down. | 89 // also delete them before we tear it down. |
| 90 browser_.reset(); | 90 browser_.reset(); |
| 91 browser_popup_.reset(); | 91 browser_popup_.reset(); |
| 92 window_positioner_.reset(); | 92 window_positioner_.reset(); |
| 93 AshTestBase::TearDown(); | 93 AshTestBase::TearDown(); |
| 94 } | 94 } |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 // Check that the popup is placed full screen. | 224 // Check that the popup is placed full screen. |
| 225 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 225 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
| 226 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 226 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
| 227 pop_position.width(), pop_position.height()), | 227 pop_position.width(), pop_position.height()), |
| 228 full); | 228 full); |
| 229 } | 229 } |
| 230 | 230 |
| 231 } // namespace test | 231 } // namespace test |
| 232 } // namespace ash | 232 } // namespace ash |
| OLD | NEW |