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

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

Issue 965573002: Implement support for silent notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix tests Created 5 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_browsertest.cc
diff --git a/chrome/browser/notifications/platform_notification_service_browsertest.cc b/chrome/browser/notifications/platform_notification_service_browsertest.cc
index d48d255dae5c7585946e2a15a636d7f5c5b96426..e35a27fd67197622212f685fc54f51d9cbff3a0a 100644
--- a/chrome/browser/notifications/platform_notification_service_browsertest.cc
+++ b/chrome/browser/notifications/platform_notification_service_browsertest.cc
@@ -224,6 +224,31 @@ IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
}
IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
+ WebNotificationOptionsReflection) {
+ std::string script_result;
+
+ // TODO(peter): It doesn't add much value if we use the InfoBarResponder for
+ // each test. Rather, we should just toggle the content setting.
+ InfoBarResponder accepting_responder(browser(), true);
+ ASSERT_TRUE(RunScript("RequestPermission()", &script_result));
+ EXPECT_EQ("granted", script_result);
+
+ ASSERT_TRUE(RunScript("DisplayPersistentAllOptionsNotification()",
+ &script_result));
+ EXPECT_EQ("ok", script_result);
+
+ ASSERT_EQ(1u, ui_manager()->GetNotificationCount());
+
+ // We don't use or check the notification's direction and language.
+ const Notification& notification = ui_manager()->GetNotificationAt(0);
+ EXPECT_EQ("Title", base::UTF16ToUTF8(notification.title()));
+ EXPECT_EQ("Contents", base::UTF16ToUTF8(notification.message()));
+ EXPECT_EQ("replace-id", base::UTF16ToUTF8(notification.replace_id()));
+ EXPECT_FALSE(notification.icon().IsEmpty());
+ EXPECT_TRUE(notification.silent());
+}
+
+IN_PROC_BROWSER_TEST_F(PlatformNotificationServiceBrowserTest,
CloseDisplayedPersistentNotification) {
std::string script_result;

Powered by Google App Engine
This is Rietveld 408576698