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/test/ash_test_base.h" | 5 #include "ash/test/ash_test_base.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/display/extended_mouse_warp_controller.h" | 10 #include "ash/display/extended_mouse_warp_controller.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 ash_test_helper_->TearDown(); | 184 ash_test_helper_->TearDown(); |
185 | 185 |
186 event_generator_.reset(); | 186 event_generator_.reset(); |
187 // Some tests set an internal display id, | 187 // Some tests set an internal display id, |
188 // reset it here, so other tests will continue in a clean environment. | 188 // reset it here, so other tests will continue in a clean environment. |
189 display::Display::SetInternalDisplayId(display::kInvalidDisplayId); | 189 display::Display::SetInternalDisplayId(display::kInvalidDisplayId); |
190 } | 190 } |
191 | 191 |
192 // static | 192 // static |
193 WmShelf* AshTestBase::GetPrimaryShelf() { | 193 WmShelf* AshTestBase::GetPrimaryShelf() { |
194 return ShellPort::Get() | 194 return Shell::GetPrimaryRootWindowController()->GetShelf(); |
195 ->GetPrimaryRootWindow() | |
196 ->GetRootWindowController() | |
197 ->GetShelf(); | |
198 } | 195 } |
199 | 196 |
200 // static | 197 // static |
201 SystemTray* AshTestBase::GetPrimarySystemTray() { | 198 SystemTray* AshTestBase::GetPrimarySystemTray() { |
202 return Shell::Get()->GetPrimarySystemTray(); | 199 return Shell::Get()->GetPrimarySystemTray(); |
203 } | 200 } |
204 | 201 |
205 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { | 202 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { |
206 if (!event_generator_) { | 203 if (!event_generator_) { |
207 event_generator_.reset( | 204 event_generator_.reset( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // static | 237 // static |
241 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( | 238 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( |
242 views::WidgetDelegate* delegate, | 239 views::WidgetDelegate* delegate, |
243 int container_id, | 240 int container_id, |
244 const gfx::Rect& bounds) { | 241 const gfx::Rect& bounds) { |
245 std::unique_ptr<views::Widget> widget(new views::Widget); | 242 std::unique_ptr<views::Widget> widget(new views::Widget); |
246 views::Widget::InitParams params; | 243 views::Widget::InitParams params; |
247 params.delegate = delegate; | 244 params.delegate = delegate; |
248 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 245 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
249 params.bounds = bounds; | 246 params.bounds = bounds; |
250 ShellPort::Get() | 247 Shell::GetPrimaryRootWindowController() |
251 ->GetPrimaryRootWindow() | |
252 ->GetRootWindowController() | |
253 ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id, | 248 ->ConfigureWidgetInitParamsForContainer(widget.get(), container_id, |
254 ¶ms); | 249 ¶ms); |
255 widget->Init(params); | 250 widget->Init(params); |
256 widget->Show(); | 251 widget->Show(); |
257 return widget; | 252 return widget; |
258 } | 253 } |
259 | 254 |
260 std::unique_ptr<aura::Window> AshTestBase::CreateTestWindow( | 255 std::unique_ptr<aura::Window> AshTestBase::CreateTestWindow( |
261 const gfx::Rect& bounds_in_screen, | 256 const gfx::Rect& bounds_in_screen, |
262 ui::wm::WindowType type, | 257 ui::wm::WindowType type, |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 return display::Screen::GetScreen()->GetDisplayNearestWindow( | 490 return display::Screen::GetScreen()->GetDisplayNearestWindow( |
496 Shell::GetPrimaryRootWindow()); | 491 Shell::GetPrimaryRootWindow()); |
497 } | 492 } |
498 | 493 |
499 display::Display AshTestBase::GetSecondaryDisplay() { | 494 display::Display AshTestBase::GetSecondaryDisplay() { |
500 return ash_test_helper_->GetSecondaryDisplay(); | 495 return ash_test_helper_->GetSecondaryDisplay(); |
501 } | 496 } |
502 | 497 |
503 } // namespace test | 498 } // namespace test |
504 } // namespace ash | 499 } // namespace ash |
OLD | NEW |