Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: chrome/test/base/view_event_test_base.cc

Issue 12375004: Re-home the global MessageCenter to support Ash+Win environments. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merge master. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/base/testing_browser_process.cc ('k') | ui/message_center/message_center.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cbf1f5e2cd9666a5c590767c43ee4f494f29152a..91b1855a917392c5bbfbab0d8131abf6d8ade72d 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)
« no previous file with comments | « chrome/test/base/testing_browser_process.cc ('k') | ui/message_center/message_center.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698