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

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: nits 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..05d30e51886a6c91367bbdfc88a1c10f8a74948e 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
+++ b/chrome/browser/notifications/notification_platform_bridge_mac_unittest.mm
@@ -5,6 +5,7 @@
#import <AppKit/AppKit.h>
#include "base/mac/scoped_nsobject.h"
+#include "chrome/browser/notifications/notification_common.h"
#include "chrome/browser/notifications/notification_platform_bridge_mac.h"
#include "chrome/browser/ui/cocoa/notifications/notification_builder_mac.h"
#include "chrome/browser/ui/cocoa/notifications/notification_constants_mac.h"
@@ -26,6 +27,9 @@ NSMutableDictionary* BuildDefaultNotificationResponse() {
[builder setNotificationId:@"notificationId"];
[builder setProfileId:@"profileId"];
[builder setIncognito:false];
+ [builder
+ setNotificationType:[NSNumber
+ numberWithInt:NotificationCommon::PERSISTENT]];
NSUserNotification* notification = [builder buildUserNotification];
return [NSMutableDictionary
@@ -40,6 +44,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