OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_helper.h" | 5 #include "ash/test/ash_test_helper.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/test/display_manager_test_api.h" | 10 #include "ash/test/display_manager_test_api.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); | 111 TestSystemTrayDelegate::SetInitialLoginStatus(user::LOGGED_IN_USER); |
112 | 112 |
113 ui::ShutdownInputMethodForTesting(); | 113 ui::ShutdownInputMethodForTesting(); |
114 zero_duration_mode_.reset(); | 114 zero_duration_mode_.reset(); |
115 | 115 |
116 CHECK(!views::corewm::ScopedCaptureClient::IsActive()); | 116 CHECK(!views::corewm::ScopedCaptureClient::IsActive()); |
117 } | 117 } |
118 | 118 |
119 void AshTestHelper::RunAllPendingInMessageLoop() { | 119 void AshTestHelper::RunAllPendingInMessageLoop() { |
120 DCHECK(base::MessageLoopForUI::current() == message_loop_); | 120 DCHECK(base::MessageLoopForUI::current() == message_loop_); |
| 121 aura::Env::CreateInstance(); |
121 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 122 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); |
122 run_loop.RunUntilIdle(); | 123 run_loop.RunUntilIdle(); |
123 } | 124 } |
124 | 125 |
125 aura::RootWindow* AshTestHelper::CurrentContext() { | 126 aura::RootWindow* AshTestHelper::CurrentContext() { |
126 aura::RootWindow* root_window = Shell::GetTargetRootWindow(); | 127 aura::RootWindow* root_window = Shell::GetTargetRootWindow(); |
127 if (!root_window) | 128 if (!root_window) |
128 root_window = Shell::GetPrimaryRootWindow(); | 129 root_window = Shell::GetPrimaryRootWindow(); |
129 DCHECK(root_window); | 130 DCHECK(root_window); |
130 return root_window; | 131 return root_window; |
131 } | 132 } |
132 | 133 |
133 } // namespace test | 134 } // namespace test |
134 } // namespace ash | 135 } // namespace ash |
OLD | NEW |