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 "chrome/browser/ui/ash/window_positioner.h" | 5 #include "chrome/browser/ui/ash/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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 } | 114 } |
115 | 115 |
116 WindowPositionerTest::~WindowPositionerTest() { | 116 WindowPositionerTest::~WindowPositionerTest() { |
117 profile_.reset(NULL); | 117 profile_.reset(NULL); |
118 ui_thread_.reset(NULL); | 118 ui_thread_.reset(NULL); |
119 } | 119 } |
120 | 120 |
121 void WindowPositionerTest::SetUp() { | 121 void WindowPositionerTest::SetUp() { |
122 AshTestBase::SetUp(); | 122 AshTestBase::SetUp(); |
123 // Create some default dummy windows. | 123 // Create some default dummy windows. |
124 window_.reset(aura::test::CreateTestWindowWithId(0, NULL)); | 124 window_.reset(CreateTestWindowInShellWithId(0)); |
125 window_->SetBounds(gfx::Rect(16, 32, 640, 320)); | 125 window_->SetBounds(gfx::Rect(16, 32, 640, 320)); |
126 popup_.reset(aura::test::CreateTestWindowWithId(1, NULL)); | 126 popup_.reset(CreateTestWindowInShellWithId(1)); |
127 popup_->SetBounds(gfx::Rect(16, 32, 128, 256)); | 127 popup_->SetBounds(gfx::Rect(16, 32, 128, 256)); |
128 panel_.reset(aura::test::CreateTestWindowWithId(2, NULL)); | 128 panel_.reset(CreateTestWindowInShellWithId(2)); |
129 panel_->SetBounds(gfx::Rect(32, 48, 256, 512)); | 129 panel_->SetBounds(gfx::Rect(32, 48, 256, 512)); |
130 | 130 |
131 // Create a browser for the window. | 131 // Create a browser for the window. |
132 browser_window_.reset(new TestBrowserWindowAura(window_.get())); | 132 browser_window_.reset(new TestBrowserWindowAura(window_.get())); |
133 Browser::CreateParams window_params(profile_.get()); | 133 Browser::CreateParams window_params(profile_.get()); |
134 window_params.window = browser_window_.get(); | 134 window_params.window = browser_window_.get(); |
135 window_owning_browser_.reset(new Browser(window_params)); | 135 window_owning_browser_.reset(new Browser(window_params)); |
136 | 136 |
137 // Creating a browser for the popup. | 137 // Creating a browser for the popup. |
138 browser_popup_.reset(new TestBrowserWindowAura(popup_.get())); | 138 browser_popup_.reset(new TestBrowserWindowAura(popup_.get())); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 | 319 |
320 // Check that the popup is placed full screen. | 320 // Check that the popup is placed full screen. |
321 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); | 321 gfx::Rect full = window_positioner()->GetPopupPosition(pop_position); |
322 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), | 322 EXPECT_EQ(gfx::Rect(work_area.x(), work_area.y(), |
323 pop_position.width(), pop_position.height()), | 323 pop_position.width(), pop_position.height()), |
324 full); | 324 full); |
325 } | 325 } |
326 | 326 |
327 } // namespace test | 327 } // namespace test |
328 } // namespace ash | 328 } // namespace ash |
OLD | NEW |