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

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 2528013002: Initialize the message center as part of the testing browser process (Closed)
Patch Set: re-uploding due to time outs Created 4 years, 1 month 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
Index: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index 2f79b35ba28726a7a4df6c89f2a6657713a91913..ea2e701225fe4cfa68c663fa54e6ce7f20427d05 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -367,8 +367,16 @@ bool PlatformNotificationServiceImpl::GetDisplayedPersistentNotifications(
DCHECK(displayed_notifications);
Profile* profile = Profile::FromBrowserContext(browser_context);
- if (!profile || profile->AsTestingProfile())
- return false; // Tests will not have a message center.
+ if (!profile)
+ return false;
+
+ NotificationDisplayService* display_service =
+ GetNotificationDisplayService(profile);
+ if (!display_service) {
+ // Tests might not have a browser process
+ DCHECK(profile->AsTestingProfile());
+ return false;
+ }
// TODO(peter): Filter for persistent notifications only.
return GetNotificationDisplayService(profile)->GetDisplayed(

Powered by Google App Engine
This is Rietveld 408576698