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

Unified Diff: chrome/browser/push_messaging/push_messaging_browsertest.cc

Issue 1814923002: Nuke NotificationUIManager from PlatformNotificationServiceImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profile_manager_load
Patch Set: Created 4 years, 8 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/push_messaging/push_messaging_browsertest.cc
diff --git a/chrome/browser/push_messaging/push_messaging_browsertest.cc b/chrome/browser/push_messaging/push_messaging_browsertest.cc
index ba9a28ec93e6ed861b2229fbb466117cf2de64e2..59bce4c19c2ab4024c1c65b6df1e281a1d787969 100644
--- a/chrome/browser/push_messaging/push_messaging_browsertest.cc
+++ b/chrome/browser/push_messaging/push_messaging_browsertest.cc
@@ -22,6 +22,7 @@
#include "chrome/browser/browsing_data/browsing_data_remover_factory.h"
#include "chrome/browser/browsing_data/browsing_data_remover_test_util.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
+#include "chrome/browser/notifications/chrome_notification_display_service.h"
#include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "chrome/browser/profiles/profile.h"
@@ -114,8 +115,6 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
#if defined(ENABLE_NOTIFICATIONS)
notification_manager_.reset(new StubNotificationUIManager);
- notification_service()->SetNotificationUIManagerForTesting(
- notification_manager());
#endif
InProcessBrowserTest::SetUp();
@@ -136,9 +135,14 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
gcm_service_->set_collect(true);
push_service_ =
PushMessagingServiceFactory::GetForProfile(GetBrowser()->profile());
+#if defined(ENABLE_NOTIFICATIONS)
+ display_service_.reset(new ChromeNotificationDisplayService(
+ GetBrowser()->profile(), notification_manager_.get()));
+ notification_service()->SetNotificationDisplayServiceForTesting(
+ display_service_.get());
+#endif
LoadTestPage();
-
InProcessBrowserTest::SetUpOnMainThread();
}
@@ -155,7 +159,7 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
// InProcessBrowserTest:
void TearDown() override {
#if defined(ENABLE_NOTIFICATIONS)
- notification_service()->SetNotificationUIManagerForTesting(nullptr);
+ notification_service()->SetNotificationDisplayServiceForTesting(nullptr);
#endif
InProcessBrowserTest::TearDown();
@@ -247,6 +251,7 @@ class PushMessagingBrowserTest : public InProcessBrowserTest {
#if defined(ENABLE_NOTIFICATIONS)
scoped_ptr<StubNotificationUIManager> notification_manager_;
+ scoped_ptr<ChromeNotificationDisplayService> display_service_;
#endif
DISALLOW_COPY_AND_ASSIGN(PushMessagingBrowserTest);

Powered by Google App Engine
This is Rietveld 408576698