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

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: 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..7c284f8736e973bff0c0f668e4de64ce6a438546 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);
+ notification_data.actions[0].title = "Button 1";
+ notification_data.actions[1].title = "Button 2";
MockDesktopNotificationDelegate* delegate
= new MockDesktopNotificationDelegate();
@@ -210,6 +213,10 @@ TEST_F(PlatformNotificationServiceTest, DisplayPageNotificationMatches) {
testing::ElementsAreArray(kNotificationVibrationPattern));
EXPECT_TRUE(notification.silent());
+
+ ASSERT_EQ(2, notification.buttons().size());
+ EXPECT_EQ("Button 1", base::UTF16ToUTF8(notification.buttons()[0].title));
Peter Beverloo 2015/07/30 17:02:05 Could we cache a reference to notification.buttons
johnme 2015/07/31 18:21:31 Done (const auto& buttons)
+ EXPECT_EQ("Button 2", base::UTF16ToUTF8(notification.buttons()[1].title));
}
TEST_F(PlatformNotificationServiceTest, DisplayNameForOrigin) {

Powered by Google App Engine
This is Rietveld 408576698