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" |
11 #include "chrome/test/base/interactive_test_utils.h" | 11 #include "chrome/test/base/interactive_test_utils.h" |
12 #include "chrome/test/base/ui_test_utils.h" | 12 #include "chrome/test/base/ui_test_utils.h" |
13 #include "content/public/browser/browser_thread.h" | 13 #include "content/public/browser/browser_thread.h" |
14 #include "ui/base/ime/input_method_initializer.h" | 14 #include "ui/base/ime/input_method_initializer.h" |
15 #include "ui/base/test/ui_controls.h" | 15 #include "ui/base/test/ui_controls.h" |
16 #include "ui/message_center/message_center.h" | 16 #include "ui/message_center/message_center.h" |
17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
18 #include "ui/views/widget/desktop_aura/desktop_screen.h" | 18 #include "ui/views/widget/desktop_aura/desktop_screen.h" |
19 #include "ui/views/widget/widget.h" | 19 #include "ui/views/widget/widget.h" |
20 | 20 |
21 #if defined(USE_ASH) | 21 #if defined(USE_ASH) |
22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
23 #include "ash/test/test_session_state_delegate.h" | 23 #include "ash/test/test_session_state_delegate.h" |
24 #include "ash/test/test_shell_delegate.h" | 24 #include "ash/test/test_shell_delegate.h" |
25 #if defined(OS_WIN) | 25 #if defined(OS_WIN) |
26 #include "ui/compositor/compositor.h" | 26 #include "ui/compositor/test/context_factories_for_test.h" |
27 #endif | 27 #endif |
28 #endif | 28 #endif |
29 | 29 |
30 #if defined(USE_AURA) | 30 #if defined(USE_AURA) |
31 #include "ui/aura/client/event_client.h" | 31 #include "ui/aura/client/event_client.h" |
32 #include "ui/aura/env.h" | 32 #include "ui/aura/env.h" |
33 #include "ui/aura/root_window.h" | 33 #include "ui/aura/root_window.h" |
34 #include "ui/aura/test/aura_test_helper.h" | 34 #include "ui/aura/test/aura_test_helper.h" |
35 #endif | 35 #endif |
36 | 36 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 #if defined(OS_WIN) | 105 #if defined(OS_WIN) |
106 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when | 106 // http://crbug.com/154081 use ash::Shell code path below on win_ash bots when |
107 // interactive_ui_tests is brought up on that platform. | 107 // interactive_ui_tests is brought up on that platform. |
108 gfx::Screen::SetScreenInstance( | 108 gfx::Screen::SetScreenInstance( |
109 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); | 109 gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
110 | 110 |
111 // The ContextFactory must exist before any Compositors are created. The | 111 // The ContextFactory must exist before any Compositors are created. The |
112 // ash::Shell code path below handles this, but since we skip it we must | 112 // ash::Shell code path below handles this, but since we skip it we must |
113 // do this here. | 113 // do this here. |
114 bool allow_test_contexts = true; | 114 bool allow_test_contexts = true; |
115 ui::Compositor::InitializeContextFactoryForTests(allow_test_contexts); | 115 ui::InitializeContextFactoryForTests(allow_test_contexts); |
116 #else // !OS_WIN | 116 #else // !OS_WIN |
117 // Ash Shell can't just live on its own without a browser process, we need to | 117 // Ash Shell can't just live on its own without a browser process, we need to |
118 // also create the message center. | 118 // also create the message center. |
119 message_center::MessageCenter::Initialize(); | 119 message_center::MessageCenter::Initialize(); |
120 #if defined(OS_CHROMEOS) | 120 #if defined(OS_CHROMEOS) |
121 chromeos::CrasAudioHandler::InitializeForTesting(); | 121 chromeos::CrasAudioHandler::InitializeForTesting(); |
122 chromeos::NetworkHandler::Initialize(); | 122 chromeos::NetworkHandler::Initialize(); |
123 #endif // OS_CHROMEOS | 123 #endif // OS_CHROMEOS |
124 ash::test::TestShellDelegate* shell_delegate = | 124 ash::test::TestShellDelegate* shell_delegate = |
125 new ash::test::TestShellDelegate(); | 125 new ash::test::TestShellDelegate(); |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 dnd_thread_.reset(NULL); | 233 dnd_thread_.reset(NULL); |
234 } | 234 } |
235 | 235 |
236 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 236 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
237 StopBackgroundThread(); | 237 StopBackgroundThread(); |
238 | 238 |
239 task.Run(); | 239 task.Run(); |
240 if (HasFatalFailure()) | 240 if (HasFatalFailure()) |
241 Done(); | 241 Done(); |
242 } | 242 } |
OLD | NEW |