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

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

Issue 1267673003: Plumb Blink notification actions to button UI on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Notifications database integration Created 5 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/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 9c4e58b941eaaf8512b53af43f01eea1cdd75ddf..7c4542a4a2e12ecc2657c5b0ab04b8e45e4ccd84 100644
--- a/chrome/browser/notifications/platform_notification_service_unittest.cc
+++ b/chrome/browser/notifications/platform_notification_service_unittest.cc
@@ -187,6 +187,9 @@ TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) {
notification_data.body = base::ASCIIToUTF16("Hello, world!");
notification_data.vibration_pattern = vibration_pattern;
notification_data.silent = true;
+ notification_data.actions.resize(2);
Peter Beverloo 2015/07/31 19:17:51 nit: operator[] will do this for you (that's why i
johnme 2015/07/31 19:38:24 Only for maps, not for vectors!
+ notification_data.actions[0].title = base::ASCIIToUTF16("Button 1");
+ notification_data.actions[1].title = base::ASCIIToUTF16("Button 2");
MockDesktopNotificationDelegate* delegate
= new MockDesktopNotificationDelegate();
@@ -210,6 +213,11 @@ TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) {
testing::ElementsAreArray(kNotificationVibrationPattern));
EXPECT_TRUE(notification.silent());
+
+ const auto& buttons = notification.buttons();
+ ASSERT_EQ(2u, buttons.size());
+ EXPECT_EQ("Button 1", base::UTF16ToUTF8(buttons[0].title));
+ EXPECT_EQ("Button 2", base::UTF16ToUTF8(buttons[1].title));
}
TEST_F(PlatformNotificationServiceTest, DisplayNameForOrigin) {

Powered by Google App Engine
This is Rietveld 408576698