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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm

Issue 2093953002: Introduce a new API to handle native notification clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: initial review Created 4 years, 5 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/notification_platform_bridge_mac_unittest.mm
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
index 509729a5db138ef14d2fbe42e534c1cde44bfd7f..fc12821b03232131eafed56089f538755253e330 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
+++ b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
@@ -26,6 +26,7 @@ NSMutableDictionary* BuildDefaultNotificationResponse() {
[builder setNotificationId:@"notificationId"];
[builder setProfileId:@"profileId"];
[builder setIncognito:false];
+ [builder setNotificationType:[NSNumber numberWithInt:0]];
NSUserNotification* notification = [builder buildUserNotification];
return [NSMutableDictionary
@@ -40,6 +41,13 @@ TEST(NotificationPlatformBridgeMacTest, TestNotificationValidResponse) {
EXPECT_TRUE(NotificationPlatformBridgeMac::VerifyNotificationData(response));
}
+TEST(NotificationPlatformBridgeMacTest, TestNotificationUnknownType) {
+ NSMutableDictionary* response = BuildDefaultNotificationResponse();
+ [response setValue:[NSNumber numberWithInt:210581]
+ forKey:notification_constants::kNotificationType];
+ EXPECT_FALSE(NotificationPlatformBridgeMac::VerifyNotificationData(response));
+}
+
TEST(NotificationPlatformBridgeMacTest, TestNotificationUnknownOperation) {
NSMutableDictionary* response = BuildDefaultNotificationResponse();
[response setValue:[NSNumber numberWithInt:40782]

Powered by Google App Engine
This is Rietveld 408576698