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 "chrome/test/base/view_event_test_base.h" | 5 #include "chrome/test/base/view_event_test_base.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 chromeos::DBusThreadManager::InitializeWithStub(); | 124 chromeos::DBusThreadManager::InitializeWithStub(); |
125 chromeos::CrasAudioHandler::InitializeForTesting(); | 125 chromeos::CrasAudioHandler::InitializeForTesting(); |
126 chromeos::NetworkHandler::Initialize(); | 126 chromeos::NetworkHandler::Initialize(); |
127 #endif // OS_CHROMEOS | 127 #endif // OS_CHROMEOS |
128 ash::test::TestShellDelegate* shell_delegate = | 128 ash::test::TestShellDelegate* shell_delegate = |
129 new ash::test::TestShellDelegate(); | 129 new ash::test::TestShellDelegate(); |
130 ash::Shell::CreateInstance(shell_delegate); | 130 ash::Shell::CreateInstance(shell_delegate); |
131 shell_delegate->test_session_state_delegate() | 131 shell_delegate->test_session_state_delegate() |
132 ->SetActiveUserSessionStarted(true); | 132 ->SetActiveUserSessionStarted(true); |
133 context = ash::Shell::GetPrimaryRootWindow(); | 133 context = ash::Shell::GetPrimaryRootWindow(); |
134 context->GetDispatcher()->host()->Show(); | 134 context->GetHost()->Show(); |
135 #endif // !OS_WIN | 135 #endif // !OS_WIN |
136 aura::Env::CreateInstance(); | 136 aura::Env::CreateInstance(); |
137 #elif defined(USE_AURA) | 137 #elif defined(USE_AURA) |
138 // Instead of using the ash shell, use an AuraTestHelper to create and manage | 138 // Instead of using the ash shell, use an AuraTestHelper to create and manage |
139 // the test screen. | 139 // the test screen. |
140 aura_test_helper_.reset( | 140 aura_test_helper_.reset( |
141 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 141 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
142 aura_test_helper_->SetUp(); | 142 aura_test_helper_->SetUp(); |
143 context = aura_test_helper_->root_window(); | 143 context = aura_test_helper_->root_window(); |
144 #endif // !USE_ASH && USE_AURA | 144 #endif // !USE_ASH && USE_AURA |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 dnd_thread_.reset(NULL); | 244 dnd_thread_.reset(NULL); |
245 } | 245 } |
246 | 246 |
247 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 247 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
248 StopBackgroundThread(); | 248 StopBackgroundThread(); |
249 | 249 |
250 task.Run(); | 250 task.Run(); |
251 if (HasFatalFailure()) | 251 if (HasFatalFailure()) |
252 Done(); | 252 Done(); |
253 } | 253 } |
OLD | NEW |