Chromium Code Reviews| 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/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/system/tray/test_system_tray_delegate.h" | 9 #include "ash/system/tray/test_system_tray_delegate.h" |
| 10 #include "ash/test/display_manager_test_api.h" | 10 #include "ash/test/display_manager_test_api.h" |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 104 |
| 105 ui::ShutdownInputMethodForTesting(); | 105 ui::ShutdownInputMethodForTesting(); |
| 106 zero_duration_mode_.reset(); | 106 zero_duration_mode_.reset(); |
| 107 | 107 |
| 108 CHECK(!views::corewm::ScopedCaptureClient::IsActive()); | 108 CHECK(!views::corewm::ScopedCaptureClient::IsActive()); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void AshTestHelper::RunAllPendingInMessageLoop() { | 111 void AshTestHelper::RunAllPendingInMessageLoop() { |
| 112 #if !defined(OS_MACOSX) | 112 #if !defined(OS_MACOSX) |
| 113 DCHECK(base::MessageLoopForUI::current() == message_loop_); | 113 DCHECK(base::MessageLoopForUI::current() == message_loop_); |
| 114 aura::Env::CreateInstance(); | |
|
dnicoara
2013/09/10 19:15:00
This is needed since this function is being called
| |
| 114 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); | 115 base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher()); |
| 115 run_loop.RunUntilIdle(); | 116 run_loop.RunUntilIdle(); |
| 116 #endif | 117 #endif |
| 117 } | 118 } |
| 118 | 119 |
| 119 aura::RootWindow* AshTestHelper::CurrentContext() { | 120 aura::RootWindow* AshTestHelper::CurrentContext() { |
| 120 aura::RootWindow* root_window = Shell::GetActiveRootWindow(); | 121 aura::RootWindow* root_window = Shell::GetActiveRootWindow(); |
| 121 if (!root_window) | 122 if (!root_window) |
| 122 root_window = Shell::GetPrimaryRootWindow(); | 123 root_window = Shell::GetPrimaryRootWindow(); |
| 123 DCHECK(root_window); | 124 DCHECK(root_window); |
| 124 return root_window; | 125 return root_window; |
| 125 } | 126 } |
| 126 | 127 |
| 127 } // namespace test | 128 } // namespace test |
| 128 } // namespace ash | 129 } // namespace ash |
| OLD | NEW |