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 13 matching lines...) Expand all Loading... | |
24 #include "ash/shell.h" | 24 #include "ash/shell.h" |
25 #include "ash/test/test_session_state_delegate.h" | 25 #include "ash/test/test_session_state_delegate.h" |
26 #include "ash/test/test_shell_delegate.h" | 26 #include "ash/test/test_shell_delegate.h" |
27 #endif | 27 #endif |
28 | 28 |
29 #if defined(USE_AURA) | 29 #if defined(USE_AURA) |
30 #include "ui/aura/client/event_client.h" | 30 #include "ui/aura/client/event_client.h" |
31 #include "ui/aura/env.h" | 31 #include "ui/aura/env.h" |
32 #include "ui/aura/root_window.h" | 32 #include "ui/aura/root_window.h" |
33 #include "ui/aura/test/aura_test_helper.h" | 33 #include "ui/aura/test/aura_test_helper.h" |
34 #include "ui/aura/window_tree_host.h" | |
34 #include "ui/views/corewm/wm_state.h" | 35 #include "ui/views/corewm/wm_state.h" |
35 #endif | 36 #endif |
36 | 37 |
37 #if defined(OS_CHROMEOS) | 38 #if defined(OS_CHROMEOS) |
38 #include "chromeos/audio/cras_audio_handler.h" | 39 #include "chromeos/audio/cras_audio_handler.h" |
39 #include "chromeos/dbus/dbus_thread_manager.h" | 40 #include "chromeos/dbus/dbus_thread_manager.h" |
40 #include "chromeos/network/network_handler.h" | 41 #include "chromeos/network/network_handler.h" |
41 #endif | 42 #endif |
42 | 43 |
43 namespace { | 44 namespace { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
120 chromeos::DBusThreadManager::InitializeWithStub(); | 121 chromeos::DBusThreadManager::InitializeWithStub(); |
121 chromeos::CrasAudioHandler::InitializeForTesting(); | 122 chromeos::CrasAudioHandler::InitializeForTesting(); |
122 chromeos::NetworkHandler::Initialize(); | 123 chromeos::NetworkHandler::Initialize(); |
123 #endif // OS_CHROMEOS | 124 #endif // OS_CHROMEOS |
124 ash::test::TestShellDelegate* shell_delegate = | 125 ash::test::TestShellDelegate* shell_delegate = |
125 new ash::test::TestShellDelegate(); | 126 new ash::test::TestShellDelegate(); |
126 ash::Shell::CreateInstance(shell_delegate); | 127 ash::Shell::CreateInstance(shell_delegate); |
127 shell_delegate->test_session_state_delegate() | 128 shell_delegate->test_session_state_delegate() |
128 ->SetActiveUserSessionStarted(true); | 129 ->SetActiveUserSessionStarted(true); |
129 context = ash::Shell::GetPrimaryRootWindow(); | 130 context = ash::Shell::GetPrimaryRootWindow(); |
131 context->GetDispatcher()->host()->Show(); | |
sadrul
2014/02/14 19:18:10
This change doesn't look relevant (since this is f
pkotwicz
2014/02/14 19:57:18
I am trying to keep ui_controls_factory_aurax11.cc
| |
130 #endif // !OS_WIN | 132 #endif // !OS_WIN |
131 aura::Env::CreateInstance(); | 133 aura::Env::CreateInstance(); |
132 #elif defined(USE_AURA) | 134 #elif defined(USE_AURA) |
133 // Instead of using the ash shell, use an AuraTestHelper to create and manage | 135 // Instead of using the ash shell, use an AuraTestHelper to create and manage |
134 // the test screen. | 136 // the test screen. |
135 aura_test_helper_.reset( | 137 aura_test_helper_.reset( |
136 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 138 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
137 bool allow_test_contexts = true; | 139 bool allow_test_contexts = true; |
138 aura_test_helper_->SetUp(allow_test_contexts); | 140 aura_test_helper_->SetUp(allow_test_contexts); |
139 context = aura_test_helper_->root_window(); | 141 context = aura_test_helper_->root_window(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
237 dnd_thread_.reset(NULL); | 239 dnd_thread_.reset(NULL); |
238 } | 240 } |
239 | 241 |
240 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 242 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
241 StopBackgroundThread(); | 243 StopBackgroundThread(); |
242 | 244 |
243 task.Run(); | 245 task.Run(); |
244 if (HasFatalFailure()) | 246 if (HasFatalFailure()) |
245 Done(); | 247 Done(); |
246 } | 248 } |
OLD | NEW |