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

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

Issue 2921263002: Remove many delegates, let's see what breaks
Patch Set: fix test Created 3 years, 6 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 cd2715ee19998080f472055f0cf51cf97c20140e..299e37d642c845778d08e17038ecf211ef7f6d34 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -17,11 +17,11 @@
#include "build/build_config.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/notifications/message_center_display_service.h"
-#include "chrome/browser/notifications/native_notification_delegate.h"
#include "chrome/browser/notifications/notification_display_service_factory.h"
#include "chrome/browser/notifications/notification_test_util.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "chrome/browser/notifications/stub_notification_platform_bridge.h"
+#include "chrome/browser/notifications/web_notification_delegate.h"
#include "chrome/common/chrome_features.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
@@ -351,11 +351,13 @@ TEST_F(PlatformNotificationServiceTest, CreateNotificationFromData) {
PlatformNotificationData notification_data;
notification_data.title = base::ASCIIToUTF16("My Notification");
notification_data.body = base::ASCIIToUTF16("Hello, world!");
+ GURL origin("https://chrome.com/");
Notification notification = service()->CreateNotificationFromData(
- profile(), GURL() /* service_worker_scope */, GURL("https://chrome.com/"),
- notification_data, NotificationResources(),
- new NativeNotificationDelegate("hello"));
+ profile(), GURL() /* service_worker_scope */, origin, notification_data,
+ NotificationResources(),
+ new WebNotificationDelegate(NotificationCommon::PERSISTENT, profile(),
+ "id", origin));
EXPECT_TRUE(notification.context_message().empty());
// Create a mocked extension.
@@ -378,7 +380,8 @@ TEST_F(PlatformNotificationServiceTest, CreateNotificationFromData) {
profile(), GURL() /* service_worker_scope */,
GURL("chrome-extension://honijodknafkokifofgiaalefdiedpko/main.html"),
notification_data, NotificationResources(),
- new NativeNotificationDelegate("hello"));
+ new WebNotificationDelegate(NotificationCommon::EXTENSION, profile(),
+ "id", origin));
EXPECT_EQ("NotificationTest",
base::UTF16ToUTF8(notification.context_message()));
}

Powered by Google App Engine
This is Rietveld 408576698