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 11 matching lines...) Expand all Loading... |
22 #include "ui/compositor/test/context_factories_for_test.h" | 22 #include "ui/compositor/test/context_factories_for_test.h" |
23 #include "ui/compositor/test/context_factories_for_test.h" | 23 #include "ui/compositor/test/context_factories_for_test.h" |
24 #include "ui/message_center/message_center.h" | 24 #include "ui/message_center/message_center.h" |
25 #include "ui/views/view.h" | 25 #include "ui/views/view.h" |
26 #include "ui/views/widget/widget.h" | 26 #include "ui/views/widget/widget.h" |
27 #include "ui/wm/core/default_activation_client.h" | 27 #include "ui/wm/core/default_activation_client.h" |
28 #include "ui/wm/core/wm_state.h" | 28 #include "ui/wm/core/wm_state.h" |
29 | 29 |
30 #if defined(USE_ASH) | 30 #if defined(USE_ASH) |
31 #include "ash/shell.h" | 31 #include "ash/shell.h" |
| 32 #include "ash/shell_init_params.h" |
32 #include "ash/test/test_session_state_delegate.h" | 33 #include "ash/test/test_session_state_delegate.h" |
33 #include "ash/test/test_shell_delegate.h" | 34 #include "ash/test/test_shell_delegate.h" |
34 #endif | 35 #endif |
35 | 36 |
36 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
37 #include "chromeos/audio/cras_audio_handler.h" | 38 #include "chromeos/audio/cras_audio_handler.h" |
38 #include "chromeos/dbus/dbus_thread_manager.h" | 39 #include "chromeos/dbus/dbus_thread_manager.h" |
39 #include "chromeos/network/network_handler.h" | 40 #include "chromeos/network/network_handler.h" |
40 #else // !defined(OS_CHROMEOS) | 41 #else // !defined(OS_CHROMEOS) |
41 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 42 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // Ash Shell can't just live on its own without a browser process, we need to | 122 // Ash Shell can't just live on its own without a browser process, we need to |
122 // also create the message center. | 123 // also create the message center. |
123 message_center::MessageCenter::Initialize(); | 124 message_center::MessageCenter::Initialize(); |
124 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
125 chromeos::DBusThreadManager::InitializeWithStub(); | 126 chromeos::DBusThreadManager::InitializeWithStub(); |
126 chromeos::CrasAudioHandler::InitializeForTesting(); | 127 chromeos::CrasAudioHandler::InitializeForTesting(); |
127 chromeos::NetworkHandler::Initialize(); | 128 chromeos::NetworkHandler::Initialize(); |
128 #endif // OS_CHROMEOS | 129 #endif // OS_CHROMEOS |
129 ash::test::TestShellDelegate* shell_delegate = | 130 ash::test::TestShellDelegate* shell_delegate = |
130 new ash::test::TestShellDelegate(); | 131 new ash::test::TestShellDelegate(); |
131 ash::Shell::CreateInstance(shell_delegate); | 132 ash::ShellInitParams init_params; |
| 133 init_params.delegate = shell_delegate; |
| 134 ash::Shell::CreateInstance(init_params); |
132 shell_delegate->test_session_state_delegate() | 135 shell_delegate->test_session_state_delegate() |
133 ->SetActiveUserSessionStarted(true); | 136 ->SetActiveUserSessionStarted(true); |
134 context = ash::Shell::GetPrimaryRootWindow(); | 137 context = ash::Shell::GetPrimaryRootWindow(); |
135 context->GetHost()->Show(); | 138 context->GetHost()->Show(); |
136 #endif // !OS_WIN | 139 #endif // !OS_WIN |
137 aura::Env::CreateInstance(true); | 140 aura::Env::CreateInstance(true); |
138 #elif defined(USE_AURA) | 141 #elif defined(USE_AURA) |
139 // Instead of using the ash shell, use an AuraTestHelper to create and manage | 142 // Instead of using the ash shell, use an AuraTestHelper to create and manage |
140 // the test screen. | 143 // the test screen. |
141 aura_test_helper_.reset( | 144 aura_test_helper_.reset( |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 dnd_thread_.reset(NULL); | 247 dnd_thread_.reset(NULL); |
245 } | 248 } |
246 | 249 |
247 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 250 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
248 StopBackgroundThread(); | 251 StopBackgroundThread(); |
249 | 252 |
250 task.Run(); | 253 task.Run(); |
251 if (HasFatalFailure()) | 254 if (HasFatalFailure()) |
252 Done(); | 255 Done(); |
253 } | 256 } |
OLD | NEW |