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

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

Issue 2749453002: Make GetDisplayedNotifications asynchronous. (Closed)
Patch Set: - Created 3 years, 9 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
Index: chrome/browser/notifications/platform_notification_service_unittest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_unittest.cc b/chrome/browser/notifications/platform_notification_service_unittest.cc
index f26cae46a79145e3165d0a2cefcc3cb3afb25ba0..a5c3296e0d8dcfdc04dc20e855923cdbba502452 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -143,9 +143,19 @@ class PlatformNotificationServiceTest : public testing::Test {
Profile* profile() const { return profile_; }
size_t GetNotificationCount() const {
- std::set<std::string> notifications;
- EXPECT_TRUE(display_service()->GetDisplayed(&notifications));
- return notifications.size();
+ size_t count = 0;
+#if defined(OS_ANDROID)
+ count = static_cast<StubNotificationPlatformBridge*>(
+ g_browser_process->notification_platform_bridge())
+ ->GetNotificationCount();
+#else
+ count =
+ static_cast<StubNotificationUIManager*>(
+ g_browser_process->notification_ui_manager())
+ ->GetAllIdsByProfile(NotificationUIManager::GetProfileID(profile_))
+ .size();
+#endif
Peter Beverloo 2017/03/15 18:07:50 This'll break on Mac pretty soon. What about:
Miguel Garcia 2017/03/16 14:57:42 It wont' break (since the stub does not have XPC).
+ return count;
}
Notification GetDisplayedNotification() {

Powered by Google App Engine
This is Rietveld 408576698