| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/common/test/ash_test.h" | 5 #include "ash/common/test/ash_test.h" |
| 6 | 6 |
| 7 #include "ash/common/shelf/wm_shelf.h" |
| 8 #include "ash/common/system/status_area_widget.h" |
| 7 #include "ash/common/test/ash_test_impl.h" | 9 #include "ash/common/test/ash_test_impl.h" |
| 8 #include "ash/common/test/test_session_state_delegate.h" | 10 #include "ash/common/test/test_session_state_delegate.h" |
| 9 #include "ash/common/wm_root_window_controller.h" | 11 #include "ash/common/wm_root_window_controller.h" |
| 10 #include "ash/common/wm_shell.h" | 12 #include "ash/common/wm_shell.h" |
| 11 #include "ash/common/wm_window.h" | 13 #include "ash/common/wm_window.h" |
| 12 #include "base/run_loop.h" | 14 #include "base/run_loop.h" |
| 13 #include "ui/compositor/layer_type.h" | 15 #include "ui/compositor/layer_type.h" |
| 14 #include "ui/display/display.h" | 16 #include "ui/display/display.h" |
| 15 | 17 |
| 16 namespace ash { | 18 namespace ash { |
| 17 | 19 |
| 18 WindowOwner::WindowOwner(WmWindow* window) : window_(window) {} | 20 WindowOwner::WindowOwner(WmWindow* window) : window_(window) {} |
| 19 | 21 |
| 20 WindowOwner::~WindowOwner() { | 22 WindowOwner::~WindowOwner() { |
| 21 window_->Destroy(); | 23 window_->Destroy(); |
| 22 } | 24 } |
| 23 | 25 |
| 24 AshTest::AshTest() : test_impl_(AshTestImpl::Create()) {} | 26 AshTest::AshTest() : test_impl_(AshTestImpl::Create()) {} |
| 25 | 27 |
| 26 AshTest::~AshTest() {} | 28 AshTest::~AshTest() {} |
| 27 | 29 |
| 28 // static | 30 // static |
| 29 WmShelf* AshTest::GetPrimaryShelf() { | 31 WmShelf* AshTest::GetPrimaryShelf() { |
| 30 return WmShell::Get() | 32 return WmShell::Get() |
| 31 ->GetPrimaryRootWindow() | 33 ->GetPrimaryRootWindow() |
| 32 ->GetRootWindowController() | 34 ->GetRootWindowController() |
| 33 ->GetShelf(); | 35 ->GetShelf(); |
| 34 } | 36 } |
| 35 | 37 |
| 38 // static |
| 39 SystemTray* AshTest::GetPrimarySystemTray() { |
| 40 return GetPrimaryShelf()->GetStatusAreaWidget()->system_tray(); |
| 41 } |
| 42 |
| 36 bool AshTest::SupportsMultipleDisplays() const { | 43 bool AshTest::SupportsMultipleDisplays() const { |
| 37 return test_impl_->SupportsMultipleDisplays(); | 44 return test_impl_->SupportsMultipleDisplays(); |
| 38 } | 45 } |
| 39 | 46 |
| 40 void AshTest::UpdateDisplay(const std::string& display_spec) { | 47 void AshTest::UpdateDisplay(const std::string& display_spec) { |
| 41 return test_impl_->UpdateDisplay(display_spec); | 48 return test_impl_->UpdateDisplay(display_spec); |
| 42 } | 49 } |
| 43 | 50 |
| 44 std::unique_ptr<WindowOwner> AshTest::CreateTestWindow(const gfx::Rect& bounds, | 51 std::unique_ptr<WindowOwner> AshTest::CreateTestWindow(const gfx::Rect& bounds, |
| 45 ui::wm::WindowType type, | 52 ui::wm::WindowType type, |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 126 |
| 120 void AshTest::SetUp() { | 127 void AshTest::SetUp() { |
| 121 test_impl_->SetUp(); | 128 test_impl_->SetUp(); |
| 122 } | 129 } |
| 123 | 130 |
| 124 void AshTest::TearDown() { | 131 void AshTest::TearDown() { |
| 125 test_impl_->TearDown(); | 132 test_impl_->TearDown(); |
| 126 } | 133 } |
| 127 | 134 |
| 128 } // namespace ash | 135 } // namespace ash |
| OLD | NEW |