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

Unified Diff: ash/test/ash_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 | « ash/system/web_notification/web_notification_tray.cc ('k') | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/test/ash_test_base.cc
diff --git a/ash/test/ash_test_base.cc b/ash/test/ash_test_base.cc
index 853cdffa216630c11d441e309ac3aacaa1b14b40..a1cf63740a66ce77cc3e83cc8d226bcaedf8f8f4 100644
--- a/ash/test/ash_test_base.cc
+++ b/ash/test/ash_test_base.cc
@@ -30,6 +30,10 @@
#include "ui/gfx/display.h"
#include "ui/gfx/screen.h"
+#if defined(ENABLE_MESSAGE_CENTER)
+#include "ui/message_center/message_center.h"
+#endif
+
#if defined(OS_WIN)
#include "ash/test/test_metro_viewer_process_host.h"
#include "base/test/test_process_killer_win.h"
@@ -96,6 +100,12 @@ void AshTestBase::SetUp() {
// Creates Shell and hook with Desktop.
test_shell_delegate_ = new TestShellDelegate;
+
+#if defined(ENABLE_MESSAGE_CENTER)
+ // Creates MessageCenter since g_browser_process is not created in AshTestBase
+ // tests.
+ message_center::MessageCenter::Initialize();
+#endif
ash::Shell::CreateInstance(test_shell_delegate_);
Shell::GetPrimaryRootWindow()->Show();
Shell::GetPrimaryRootWindow()->ShowRootWindow();
@@ -130,6 +140,12 @@ void AshTestBase::TearDown() {
// Tear down the shell.
Shell::DeleteInstance();
+
+#if defined(ENABLE_MESSAGE_CENTER)
+ // Remove global message center state.
+ message_center::MessageCenter::Shutdown();
+#endif
+
aura::Env::DeleteInstance();
ui::TextInputTestSupport::Shutdown();
« no previous file with comments | « ash/system/web_notification/web_notification_tray.cc ('k') | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698