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( |