diff options
author | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 19:10:19 +0000 |
---|---|---|
committer | dewittj@chromium.org <dewittj@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-05 19:10:19 +0000 |
commit | 35653072a19559aa077fe241c36cd509152f7535 (patch) | |
tree | 8dc2bef7514ad077c5a11dfd9c35f2859b681f3a /chrome/test/base/view_event_test_base.cc | |
parent | 6737c579fd8e5b2aa81971e5b7b8ceb7e3eb5c13 (diff) | |
download | chromium_src-35653072a19559aa077fe241c36cd509152f7535.zip chromium_src-35653072a19559aa077fe241c36cd509152f7535.tar.gz chromium_src-35653072a19559aa077fe241c36cd509152f7535.tar.bz2 |
Re-home the global MessageCenter to support Ash+Win environments.
In the case where Ash is displayed on Windows, we want a single
message center data structure with multiple UI surfaces for
notifications.
g_browser_process now manages the lifetime of the global Message
Center object, since its lifetime is always longer than Ash::Shell.
This allows us to re-enable the browser tests for message center
on Ash+Win, and stops a crash bug.
BUG=178429
Review URL: https://chromiumcodereview.appspot.com/12375004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186220 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/base/view_event_test_base.cc')
-rw-r--r-- | chrome/test/base/view_event_test_base.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc index cbf1f5e..91b1855 100644 --- a/chrome/test/base/view_event_test_base.cc +++ b/chrome/test/base/view_event_test_base.cc @@ -18,6 +18,10 @@ #include "ui/views/widget/desktop_aura/desktop_screen.h" #include "ui/views/widget/widget.h" +#if defined(ENABLE_MESSAGE_CENTER) +#include "ui/message_center/message_center.h" +#endif + #if defined(USE_ASH) #include "ash/shell.h" #include "ash/test/test_shell_delegate.h" @@ -98,6 +102,11 @@ void ViewEventTestBase::SetUp() { gfx::Screen::SetScreenInstance( gfx::SCREEN_TYPE_NATIVE, views::CreateDesktopScreen()); #else +#if defined(ENABLE_MESSAGE_CENTER) + // 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(); +#endif ash::Shell::CreateInstance(new ash::test::TestShellDelegate()); context = ash::Shell::GetPrimaryRootWindow(); #endif @@ -126,6 +135,11 @@ void ViewEventTestBase::TearDown() { #if defined(OS_WIN) #else ash::Shell::DeleteInstance(); +#if defined(ENABLE_MESSAGE_CENTER) + // 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(); +#endif aura::Env::DeleteInstance(); #endif #elif defined(USE_AURA) |