| 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/window_positioner.h" | 5 #include "ash/wm/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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 61 |
| 62 void WindowPositionerTest::SetUp() { | 62 void WindowPositionerTest::SetUp() { |
| 63 AshTestBase::SetUp(); | 63 AshTestBase::SetUp(); |
| 64 // Create some default dummy windows. | 64 // Create some default dummy windows. |
| 65 scoped_ptr<aura::Window> dummy_window(CreateTestWindowInShellWithId(0)); | 65 scoped_ptr<aura::Window> dummy_window(CreateTestWindowInShellWithId(0)); |
| 66 dummy_window->SetBounds(gfx::Rect(16, 32, 640, 320)); | 66 dummy_window->SetBounds(gfx::Rect(16, 32, 640, 320)); |
| 67 scoped_ptr<aura::Window> dummy_popup(CreateTestWindowInShellWithId(1)); | 67 scoped_ptr<aura::Window> dummy_popup(CreateTestWindowInShellWithId(1)); |
| 68 dummy_popup->SetBounds(gfx::Rect(16, 32, 128, 256)); | 68 dummy_popup->SetBounds(gfx::Rect(16, 32, 128, 256)); |
| 69 | 69 |
| 70 // Create a browser for the window. | 70 // Create a browser for the window. |
| 71 Browser::CreateParams window_params(&profile_, | 71 Browser::CreateParams window_params(&profile_); |
| 72 chrome::HOST_DESKTOP_TYPE_ASH); | |
| 73 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 72 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
| 74 std::move(dummy_window), &window_params); | 73 std::move(dummy_window), &window_params); |
| 75 | 74 |
| 76 // Creating a browser for the popup. | 75 // Creating a browser for the popup. |
| 77 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_, | 76 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_); |
| 78 chrome::HOST_DESKTOP_TYPE_ASH); | |
| 79 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 77 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
| 80 std::move(dummy_popup), &popup_params); | 78 std::move(dummy_popup), &popup_params); |
| 81 | 79 |
| 82 // 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 |
| 83 // as he needs it. | 81 // as he needs it. |
| 84 window()->Hide(); | 82 window()->Hide(); |
| 85 popup()->Hide(); | 83 popup()->Hide(); |
| 86 window_positioner_.reset(new WindowPositioner()); | 84 window_positioner_.reset(new WindowPositioner()); |
| 87 } | 85 } |
| 88 | 86 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 223 |
| 226 // Check that the popup is placed full screen. | 224 // Check that the popup is placed full screen. |
| 227 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 225 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
| 228 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 226 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
| 229 pop_position.width(), pop_position.height()), | 227 pop_position.width(), pop_position.height()), |
| 230 full); | 228 full); |
| 231 } | 229 } |
| 232 | 230 |
| 233 } // namespace test | 231 } // namespace test |
| 234 } // namespace ash | 232 } // namespace ash |
| OLD | NEW |