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

Unified Diff: chrome/browser/notifications/platform_notification_service_unittest.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/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 282ed6754ba702155c0b1417335fe80722be14c0..456d2498db5b8ef207be7ee1dfeca137a54042d4 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -12,10 +12,13 @@
#include "base/time/time.h"
#include "build/build_config.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_delegate.h"
#include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
+#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
+#include "chrome/test/base/testing_profile_manager.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "content/public/browser/desktop_notification_delegate.h"
#include "content/public/common/notification_resources.h"
@@ -80,17 +83,23 @@ class MockDesktopNotificationDelegate
class PlatformNotificationServiceTest : public testing::Test {
public:
void SetUp() override {
- ui_manager_.reset(new StubNotificationUIManager);
profile_.reset(new TestingProfile());
-
- service()->SetNotificationUIManagerForTesting(ui_manager_.get());
+ ui_manager_.reset(new StubNotificationUIManager);
+ display_service_.reset(new ChromeNotificationDisplayService(
+ profile_.get(), ui_manager_.get()));
+ service()->SetNotificationDisplayServiceForTesting(display_service_.get());
+ profile_manager_.reset(
+ new TestingProfileManager(TestingBrowserProcess::GetGlobal()));
+ ASSERT_TRUE(profile_manager_->SetUp());
}
void TearDown() override {
- service()->SetNotificationUIManagerForTesting(nullptr);
-
- profile_.reset();
+ service()->SetNotificationDisplayServiceForTesting(nullptr);
+ display_service_.reset();
ui_manager_.reset();
+ profile_.reset();
+ profile_manager_.reset();
+ TestingBrowserProcess::DeleteInstance();
}
protected:
@@ -131,9 +140,11 @@ class PlatformNotificationServiceTest : public testing::Test {
StubNotificationUIManager* ui_manager() const { return ui_manager_.get(); }
private:
- scoped_ptr<StubNotificationUIManager> ui_manager_;
scoped_ptr<TestingProfile> profile_;
+ scoped_ptr<StubNotificationUIManager> ui_manager_;
+ scoped_ptr<ChromeNotificationDisplayService> display_service_;
+ scoped_ptr<TestingProfileManager> profile_manager_;
content::TestBrowserThreadBundle thread_bundle_;
};

Powered by Google App Engine
This is Rietveld 408576698