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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "ash/test/test_shell_delegate.h" | 9 #include "ash/test/test_shell_delegate.h" |
10 #include "ash/wm/window_resizer.h" | 10 #include "ash/wm/window_resizer.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 scoped_ptr<aura::Window> dummy_window(CreateTestWindowInShellWithId(0)); | 63 scoped_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 scoped_ptr<aura::Window> dummy_popup(CreateTestWindowInShellWithId(1)); | 65 scoped_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_, ui::HOST_DESKTOP_TYPE_ASH); |
70 chrome::HOST_DESKTOP_TYPE_ASH); | |
71 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 70 browser_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
72 dummy_window.Pass(), &window_params); | 71 dummy_window.Pass(), &window_params); |
73 | 72 |
74 // Creating a browser for the popup. | 73 // Creating a browser for the popup. |
75 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_, | 74 Browser::CreateParams popup_params(Browser::TYPE_POPUP, &profile_, |
76 chrome::HOST_DESKTOP_TYPE_ASH); | 75 ui::HOST_DESKTOP_TYPE_ASH); |
77 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( | 76 browser_popup_ = chrome::CreateBrowserWithAuraTestWindowForParams( |
78 dummy_popup.Pass(), &popup_params); | 77 dummy_popup.Pass(), &popup_params); |
79 | 78 |
80 // We hide all windows upon start - each user is required to set it up | 79 // We hide all windows upon start - each user is required to set it up |
81 // as he needs it. | 80 // as he needs it. |
82 window()->Hide(); | 81 window()->Hide(); |
83 popup()->Hide(); | 82 popup()->Hide(); |
84 window_positioner_.reset(new WindowPositioner()); | 83 window_positioner_.reset(new WindowPositioner()); |
85 } | 84 } |
86 | 85 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 222 |
224 // Check that the popup is placed full screen. | 223 // Check that the popup is placed full screen. |
225 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 224 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
226 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 225 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
227 pop_position.width(), pop_position.height()), | 226 pop_position.width(), pop_position.height()), |
228 full); | 227 full); |
229 } | 228 } |
230 | 229 |
231 } // namespace test | 230 } // namespace test |
232 } // namespace ash | 231 } // namespace ash |
OLD | NEW |