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

Unified Diff: content/browser/notifications/notification_database_data_unittest.cc

Issue 1094553002: Revert "Speculative revert by sheriff" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 df147d0e3324a0c1d57ef486bfa715d96def5380..f57bfa8f23a2923ad8f62a074e6c92c28958c8a0 100644
--- a/content/browser/notifications/notification_database_data_unittest.cc
+++ b/content/browser/notifications/notification_database_data_unittest.cc
@@ -19,8 +19,12 @@ const char kNotificationLang[] = "nl";
const char kNotificationBody[] = "Hello, world!";
const char kNotificationTag[] = "my_tag";
const char kNotificationIconUrl[] = "https://example.com/icon.png";
+const unsigned char kNotificationData[] = { 0xdf, 0xff, 0x0, 0x0, 0xff, 0xdf };
TEST(NotificationDatabaseDataTest, SerializeAndDeserializeData) {
+ std::vector<char> developer_data(
+ kNotificationData, kNotificationData + arraysize(kNotificationData));
+
PlatformNotificationData notification_data;
notification_data.title = base::ASCIIToUTF16(kNotificationTitle);
notification_data.direction =
@@ -30,6 +34,7 @@ TEST(NotificationDatabaseDataTest, SerializeAndDeserializeData) {
notification_data.tag = kNotificationTag;
notification_data.icon = GURL(kNotificationIconUrl);
notification_data.silent = true;
+ notification_data.data = developer_data;
NotificationDatabaseData database_data;
database_data.notification_id = kNotificationId;
@@ -64,6 +69,10 @@ TEST(NotificationDatabaseDataTest, SerializeAndDeserializeData) {
EXPECT_EQ(notification_data.tag, copied_notification_data.tag);
EXPECT_EQ(notification_data.icon, copied_notification_data.icon);
EXPECT_EQ(notification_data.silent, copied_notification_data.silent);
+
+ 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]);
}
} // namespace content

Powered by Google App Engine
This is Rietveld 408576698