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

Unified Diff: content/child/notifications/notification_data_conversions_unittest.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: content/child/notifications/notification_data_conversions_unittest.cc
diff --git a/content/child/notifications/notification_data_conversions_unittest.cc b/content/child/notifications/notification_data_conversions_unittest.cc
index ac08574f172a01e7b9b0b129da4689869f83dffe..bf979cf2a42c3f14177783412534aa7b88667364 100644
--- a/content/child/notifications/notification_data_conversions_unittest.cc
+++ b/content/child/notifications/notification_data_conversions_unittest.cc
@@ -29,7 +29,8 @@ TEST(NotificationDataConversionsTest, ToPlatformNotificationData) {
blink::WebString::fromUTF8(kNotificationLang),
blink::WebString::fromUTF8(kNotificationBody),
blink::WebString::fromUTF8(kNotificationTag),
- blink::WebURL(GURL(kNotificationIconUrl)));
+ blink::WebURL(GURL(kNotificationIconUrl)),
+ true /* silent */);
PlatformNotificationData platform_data = ToPlatformNotificationData(web_data);
EXPECT_EQ(base::ASCIIToUTF16(kNotificationTitle), platform_data.title);
@@ -39,6 +40,7 @@ TEST(NotificationDataConversionsTest, ToPlatformNotificationData) {
EXPECT_EQ(base::ASCIIToUTF16(kNotificationBody), platform_data.body);
EXPECT_EQ(base::ASCIIToUTF16(kNotificationTag), platform_data.tag);
EXPECT_EQ(kNotificationIconUrl, platform_data.icon.spec());
+ EXPECT_TRUE(platform_data.silent);
}
TEST(NotificationDataConversionsTest,
@@ -66,6 +68,7 @@ TEST(NotificationDataConversionsTest, ToWebNotificationData) {
platform_data.body = base::ASCIIToUTF16(kNotificationBody);
platform_data.tag = base::ASCIIToUTF16(kNotificationTag);
platform_data.icon = GURL(kNotificationIconUrl);
+ platform_data.silent = true;
blink::WebNotificationData web_data = ToWebNotificationData(platform_data);
EXPECT_EQ(kNotificationTitle, web_data.title);
@@ -75,6 +78,7 @@ TEST(NotificationDataConversionsTest, ToWebNotificationData) {
EXPECT_EQ(kNotificationBody, web_data.body);
EXPECT_EQ(kNotificationTag, web_data.tag);
EXPECT_EQ(kNotificationIconUrl, web_data.icon.string());
+ EXPECT_TRUE(web_data.silent);
}
TEST(NotificationDataConversionsTest, ToWebNotificationDataDirectionality) {
« no previous file with comments | « content/child/notifications/notification_data_conversions.cc ('k') | content/common/platform_notification_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698