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

Unified Diff: chrome/browser/notifications/desktop_notifications_unittest.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/browser/browser_process_impl.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/notifications/desktop_notifications_unittest.cc
diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc
index 85ce0e23154f98007dedf8383d9807da19c136fc..aca84f18891ba26869ffbdbc487e0b073ee6a7b8 100644
--- a/chrome/browser/notifications/desktop_notifications_unittest.cc
+++ b/chrome/browser/notifications/desktop_notifications_unittest.cc
@@ -13,6 +13,10 @@
#include "chrome/common/pref_names.h"
#include "content/public/common/show_desktop_notification_params.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"
@@ -97,6 +101,11 @@ DesktopNotificationsTest::~DesktopNotificationsTest() {
void DesktopNotificationsTest::SetUp() {
#if defined(USE_ASH)
WebKit::initialize(webkit_platform_support_.Get());
+#if defined(ENABLE_MESSAGE_CENTER)
+ // The message center is notmally initialized on |g_browser_process| which
+ // is not created for these tests.
+ message_center::MessageCenter::Initialize();
+#endif
// MockBalloonCollection retrieves information about the screen on creation.
// So it is necessary to make sure the desktop gets created first.
ash::Shell::CreateInstance(new ash::test::TestShellDelegate);
@@ -119,6 +128,11 @@ void DesktopNotificationsTest::TearDown() {
#if defined(USE_ASH)
active_desktop_monitor_.reset();
ash::Shell::DeleteInstance();
+#if defined(ENABLE_MESSAGE_CENTER)
+ // The message center is notmally shutdown on |g_browser_process| which
+ // is not created for these tests.
+ message_center::MessageCenter::Shutdown();
+#endif
aura::Env::DeleteInstance();
WebKit::shutdown();
#endif
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/chrome_tests.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698