| 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 12 matching lines...) Expand all Loading... |
| 23 #include "ash/shell.h" | 23 #include "ash/shell.h" |
| 24 #include "ash/test/test_session_state_delegate.h" | 24 #include "ash/test/test_session_state_delegate.h" |
| 25 #include "ash/test/test_shell_delegate.h" | 25 #include "ash/test/test_shell_delegate.h" |
| 26 #endif | 26 #endif |
| 27 | 27 |
| 28 #if defined(USE_AURA) | 28 #if defined(USE_AURA) |
| 29 #include "ui/aura/client/event_client.h" | 29 #include "ui/aura/client/event_client.h" |
| 30 #include "ui/aura/env.h" | 30 #include "ui/aura/env.h" |
| 31 #include "ui/aura/root_window.h" | 31 #include "ui/aura/root_window.h" |
| 32 #include "ui/aura/test/aura_test_helper.h" | 32 #include "ui/aura/test/aura_test_helper.h" |
| 33 #include "ui/aura/window_tree_host.h" |
| 33 #include "ui/views/corewm/wm_state.h" | 34 #include "ui/views/corewm/wm_state.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 #endif | 41 #endif |
| 41 | 42 |
| 42 namespace { | 43 namespace { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 chromeos::DBusThreadManager::InitializeWithStub(); | 120 chromeos::DBusThreadManager::InitializeWithStub(); |
| 120 chromeos::CrasAudioHandler::InitializeForTesting(); | 121 chromeos::CrasAudioHandler::InitializeForTesting(); |
| 121 chromeos::NetworkHandler::Initialize(); | 122 chromeos::NetworkHandler::Initialize(); |
| 122 #endif // OS_CHROMEOS | 123 #endif // OS_CHROMEOS |
| 123 ash::test::TestShellDelegate* shell_delegate = | 124 ash::test::TestShellDelegate* shell_delegate = |
| 124 new ash::test::TestShellDelegate(); | 125 new ash::test::TestShellDelegate(); |
| 125 ash::Shell::CreateInstance(shell_delegate); | 126 ash::Shell::CreateInstance(shell_delegate); |
| 126 shell_delegate->test_session_state_delegate() | 127 shell_delegate->test_session_state_delegate() |
| 127 ->SetActiveUserSessionStarted(true); | 128 ->SetActiveUserSessionStarted(true); |
| 128 context = ash::Shell::GetPrimaryRootWindow(); | 129 context = ash::Shell::GetPrimaryRootWindow(); |
| 130 context->GetDispatcher()->host()->Show(); |
| 129 #endif // !OS_WIN | 131 #endif // !OS_WIN |
| 130 aura::Env::CreateInstance(); | 132 aura::Env::CreateInstance(); |
| 131 #elif defined(USE_AURA) | 133 #elif defined(USE_AURA) |
| 132 // Instead of using the ash shell, use an AuraTestHelper to create and manage | 134 // Instead of using the ash shell, use an AuraTestHelper to create and manage |
| 133 // the test screen. | 135 // the test screen. |
| 134 aura_test_helper_.reset( | 136 aura_test_helper_.reset( |
| 135 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); | 137 new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
| 136 bool allow_test_contexts = true; | 138 bool allow_test_contexts = true; |
| 137 aura_test_helper_->SetUp(allow_test_contexts); | 139 aura_test_helper_->SetUp(allow_test_contexts); |
| 138 context = aura_test_helper_->root_window(); | 140 context = aura_test_helper_->root_window(); |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 dnd_thread_.reset(NULL); | 238 dnd_thread_.reset(NULL); |
| 237 } | 239 } |
| 238 | 240 |
| 239 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { | 241 void ViewEventTestBase::RunTestMethod(const base::Closure& task) { |
| 240 StopBackgroundThread(); | 242 StopBackgroundThread(); |
| 241 | 243 |
| 242 task.Run(); | 244 task.Run(); |
| 243 if (HasFatalFailure()) | 245 if (HasFatalFailure()) |
| 244 Done(); | 246 Done(); |
| 245 } | 247 } |
| OLD | NEW |