Index: chrome/browser/notifications/platform_notification_service_browsertest.cc |
diff --git a/chrome/browser/notifications/platform_notification_service_browsertest.cc b/chrome/browser/notifications/platform_notification_service_browsertest.cc |
index 07c9e984e6dfa1bd2e870a970074d9e8a29cb016..410118def569ed565b6bcfc65852557356d306ef 100644 |
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc |
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc |
@@ -11,6 +11,7 @@ |
#include "base/path_service.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/time/time.h" |
+#include "chrome/browser/notifications/chrome_notification_display_service.h" |
#include "chrome/browser/notifications/desktop_notification_profile_util.h" |
#include "chrome/browser/notifications/notification.h" |
#include "chrome/browser/notifications/notification_permission_context.h" |
@@ -93,6 +94,7 @@ class PlatformNotificationServiceBrowserTest : public InProcessBrowserTest { |
const base::FilePath server_root_; |
const std::string test_page_url_; |
scoped_ptr<StubNotificationUIManager> ui_manager_; |
+ scoped_ptr<ChromeNotificationDisplayService> display_service_; |
scoped_ptr<net::EmbeddedTestServer> https_server_; |
}; |
@@ -122,20 +124,19 @@ void PlatformNotificationServiceBrowserTest::SetUp() { |
new net::EmbeddedTestServer(net::EmbeddedTestServer::TYPE_HTTPS)); |
https_server_->ServeFilesFromSourceDirectory(server_root_); |
ASSERT_TRUE(https_server_->Start()); |
- |
- service()->SetNotificationUIManagerForTesting(ui_manager_.get()); |
- |
InProcessBrowserTest::SetUp(); |
} |
void PlatformNotificationServiceBrowserTest::SetUpOnMainThread() { |
NavigateToTestPage(test_page_url_); |
- |
+ display_service_.reset(new ChromeNotificationDisplayService( |
+ browser()->profile(), ui_manager_.get())); |
+ service()->SetNotificationDisplayServiceForTesting(display_service_.get()); |
Peter Beverloo
2016/04/18 14:57:10
Why can't we use KeyedServiceFactory::SetTestingFa
Miguel Garcia
2016/04/19 14:24:58
Looked into it, we can for the unit test but the b
|
InProcessBrowserTest::SetUpOnMainThread(); |
} |
void PlatformNotificationServiceBrowserTest::TearDown() { |
- service()->SetNotificationUIManagerForTesting(nullptr); |
+ service()->SetNotificationDisplayServiceForTesting(nullptr); |
} |
void PlatformNotificationServiceBrowserTest:: |