| 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/common/ash_switches.h" | 10 #include "ash/common/ash_switches.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 ui::test::SetUsePopupAsRootWindowForTest(false); | 169 ui::test::SetUsePopupAsRootWindowForTest(false); |
| 170 #endif | 170 #endif |
| 171 | 171 |
| 172 event_generator_.reset(); | 172 event_generator_.reset(); |
| 173 // Some tests set an internal display id, | 173 // Some tests set an internal display id, |
| 174 // reset it here, so other tests will continue in a clean environment. | 174 // reset it here, so other tests will continue in a clean environment. |
| 175 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID); | 175 display::Display::SetInternalDisplayId(display::Display::kInvalidDisplayID); |
| 176 } | 176 } |
| 177 | 177 |
| 178 // static | 178 // static |
| 179 WmShelf* AshTestBase::GetPrimaryShelf() { |
| 180 return WmShell::Get() |
| 181 ->GetPrimaryRootWindow() |
| 182 ->GetRootWindowController() |
| 183 ->GetShelf(); |
| 184 } |
| 185 |
| 186 // static |
| 179 SystemTray* AshTestBase::GetPrimarySystemTray() { | 187 SystemTray* AshTestBase::GetPrimarySystemTray() { |
| 180 return Shell::GetInstance()->GetPrimarySystemTray(); | 188 return Shell::GetInstance()->GetPrimarySystemTray(); |
| 181 } | 189 } |
| 182 | 190 |
| 183 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { | 191 ui::test::EventGenerator& AshTestBase::GetEventGenerator() { |
| 184 if (!event_generator_) { | 192 if (!event_generator_) { |
| 185 event_generator_.reset( | 193 event_generator_.reset( |
| 186 new ui::test::EventGenerator(new AshEventGeneratorDelegate())); | 194 new ui::test::EventGenerator(new AshEventGeneratorDelegate())); |
| 187 } | 195 } |
| 188 return *event_generator_.get(); | 196 return *event_generator_.get(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 204 // static | 212 // static |
| 205 bool AshTestBase::SupportsMultipleDisplays() { | 213 bool AshTestBase::SupportsMultipleDisplays() { |
| 206 return AshTestHelper::SupportsMultipleDisplays(); | 214 return AshTestHelper::SupportsMultipleDisplays(); |
| 207 } | 215 } |
| 208 | 216 |
| 209 // static | 217 // static |
| 210 bool AshTestBase::SupportsHostWindowResize() { | 218 bool AshTestBase::SupportsHostWindowResize() { |
| 211 return AshTestHelper::SupportsHostWindowResize(); | 219 return AshTestHelper::SupportsHostWindowResize(); |
| 212 } | 220 } |
| 213 | 221 |
| 214 // static | |
| 215 WmShelf* AshTestBase::GetPrimaryShelf() { | |
| 216 return WmShell::Get() | |
| 217 ->GetPrimaryRootWindow() | |
| 218 ->GetRootWindowController() | |
| 219 ->GetShelf(); | |
| 220 } | |
| 221 | |
| 222 void AshTestBase::UpdateDisplay(const std::string& display_specs) { | 222 void AshTestBase::UpdateDisplay(const std::string& display_specs) { |
| 223 DisplayManagerTestApi().UpdateDisplay(display_specs); | 223 DisplayManagerTestApi().UpdateDisplay(display_specs); |
| 224 } | 224 } |
| 225 | 225 |
| 226 aura::Window* AshTestBase::CurrentContext() { | 226 aura::Window* AshTestBase::CurrentContext() { |
| 227 return ash_test_helper_->CurrentContext(); | 227 return ash_test_helper_->CurrentContext(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 // static | 230 // static |
| 231 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( | 231 std::unique_ptr<views::Widget> AshTestBase::CreateTestWidget( |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 | 378 |
| 379 void AshTestBase::DisableIME() { | 379 void AshTestBase::DisableIME() { |
| 380 Shell::GetInstance()->RemovePreTargetHandler( | 380 Shell::GetInstance()->RemovePreTargetHandler( |
| 381 Shell::GetInstance() | 381 Shell::GetInstance() |
| 382 ->window_tree_host_manager() | 382 ->window_tree_host_manager() |
| 383 ->input_method_event_handler()); | 383 ->input_method_event_handler()); |
| 384 } | 384 } |
| 385 | 385 |
| 386 } // namespace test | 386 } // namespace test |
| 387 } // namespace ash | 387 } // namespace ash |
| OLD | NEW |