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

Unified Diff: content/browser/notifications/notification_database_data_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: content/browser/notifications/notification_database_data_unittest.cc
diff --git a/content/browser/notifications/notification_database_data_unittest.cc b/content/browser/notifications/notification_database_data_unittest.cc
index 2613108db5c4d0030237b569c11e99beae0f2320..d783f8a6193815201023ad4d8a91829782cdec07 100644
--- a/content/browser/notifications/notification_database_data_unittest.cc
+++ b/content/browser/notifications/notification_database_data_unittest.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
#include "content/browser/notifications/notification_database_data.pb.h"
#include "content/browser/notifications/notification_database_data_conversions.h"
@@ -42,6 +43,12 @@ TEST(NotificationDatabaseDataTest, SerializeAndDeserializeData) {
notification_data.vibration_pattern = vibration_pattern;
notification_data.silent = true;
notification_data.data = developer_data;
+ for (int i = 0; i < 2; i++) {
Peter Beverloo 2015/07/31 19:17:51 nit: might as well use the constant (in case we ev
johnme 2015/07/31 19:38:24 Done.
+ PlatformNotificationAction notification_action;
+ notification_action.action = IntToString(i);
Peter Beverloo 2015/07/31 19:17:51 base::
johnme 2015/07/31 19:38:24 Done.
+ notification_action.title = IntToString16(i);
Peter Beverloo 2015/07/31 19:17:51 dito
johnme 2015/07/31 19:38:24 Done.
+ notification_data.actions.push_back(notification_action);
+ }
NotificationDatabaseData database_data;
database_data.notification_id = kNotificationId;
@@ -84,6 +91,15 @@ TEST(NotificationDatabaseDataTest, SerializeAndDeserializeData) {
ASSERT_EQ(developer_data.size(), copied_notification_data.data.size());
for (size_t i = 0; i < developer_data.size(); ++i)
EXPECT_EQ(developer_data[i], copied_notification_data.data[i]);
+
+ ASSERT_EQ(notification_data.actions.size(),
+ copied_notification_data.actions.size());
+ for (size_t i = 0; i < notification_data.actions.size(); ++i) {
+ EXPECT_EQ(notification_data.actions[i].action,
+ copied_notification_data.actions[i].action);
+ EXPECT_EQ(notification_data.actions[i].title,
+ copied_notification_data.actions[i].title);
+ }
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698