Chromium Code Reviews| Index: chrome/test/base/view_event_test_base.cc |
| diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc |
| index aabfb25f6148ec5f6617d4717be8e3bbe4e77ee4..e0e04dcb3d904399eb49e7114fe610ab8b07e1ca 100644 |
| --- a/chrome/test/base/view_event_test_base.cc |
| +++ b/chrome/test/base/view_event_test_base.cc |
| @@ -20,6 +20,7 @@ |
| #if defined(USE_ASH) |
| #include "ash/shell.h" |
| +#include "ash/test/ash_test_helper.h" |
| #include "ash/test/test_session_state_delegate.h" |
| #include "ash/test/test_shell_delegate.h" |
| #endif |
| @@ -101,23 +102,14 @@ void ViewEventTestBase::SetUp() { |
| // interactive_ui_tests is brought up on that platform. |
| gfx::Screen::SetScreenInstance( |
| gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); |
| -#else |
| - // Ash Shell can't just live on its own without a browser process, we need to |
| - // also create the message center. |
| - message_center::MessageCenter::Initialize(); |
| -#if defined(OS_CHROMEOS) |
| - chromeos::CrasAudioHandler::InitializeForTesting(); |
| -#endif |
| - ash::test::TestShellDelegate* shell_delegate = |
| - new ash::test::TestShellDelegate(); |
| - ash::Shell::CreateInstance(shell_delegate); |
| - shell_delegate->test_session_state_delegate() |
| - ->SetActiveUserSessionStarted(true); |
| - context = ash::Shell::GetPrimaryRootWindow(); |
| #endif |
| + ash_test_helper_.reset( |
|
danakj
2013/07/31 20:14:50
Instead of doing all this ash setup here, use the
|
| + new ash::test::AshTestHelper(base::MessageLoopForUI::current())); |
| + ash_test_helper_->SetUp(); |
| + context = ash_test_helper_->CurrentContext(); |
| #elif defined(USE_AURA) |
| - // Instead of using the ash shell, use an AuraTestHelper to create and manage |
| - // the test screen. |
| + // Instead of using the AshTestHelper, use an AuraTestHelper to create and |
| + // manage the test screen. |
| aura_test_helper_.reset( |
| new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); |
| aura_test_helper_->SetUp(); |
| @@ -136,21 +128,13 @@ void ViewEventTestBase::TearDown() { |
| #endif |
| window_ = NULL; |
| } |
| + |
| #if defined(USE_ASH) |
| -#if defined(OS_WIN) |
| -#else |
| - ash::Shell::DeleteInstance(); |
| -#if defined(OS_CHROMEOS) |
| - chromeos::CrasAudioHandler::Shutdown(); |
| -#endif |
| - // Ash Shell can't just live on its own without a browser process, we need to |
| - // also shut down the message center. |
| - message_center::MessageCenter::Shutdown(); |
| - aura::Env::DeleteInstance(); |
| -#endif |
| + ash_test_helper_->TearDown(); |
| #elif defined(USE_AURA) |
| aura_test_helper_->TearDown(); |
| #endif |
| + |
| ui::ShutdownInputMethodForTesting(); |
| } |