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

Side by Side Diff: content/browser/notifications/notification_database_data_unittest.cc

Issue 2300093002: Make //content responsible for generating notification Ids (Closed)
Patch Set: rebase + comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/nullable_string16.h" 9 #include "base/strings/nullable_string16.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/utf_string_conversions.h" 11 #include "base/strings/utf_string_conversions.h"
12 #include "base/time/time.h" 12 #include "base/time/time.h"
13 #include "content/browser/notifications/notification_database_data.pb.h" 13 #include "content/browser/notifications/notification_database_data.pb.h"
14 #include "content/browser/notifications/notification_database_data_conversions.h " 14 #include "content/browser/notifications/notification_database_data_conversions.h "
15 #include "content/public/browser/notification_database_data.h" 15 #include "content/public/browser/notification_database_data.h"
16 #include "testing/gmock/include/gmock/gmock.h" 16 #include "testing/gmock/include/gmock/gmock.h"
17 #include "testing/gtest/include/gtest/gtest.h" 17 #include "testing/gtest/include/gtest/gtest.h"
18 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onConstants.h" 18 #include "third_party/WebKit/public/platform/modules/notifications/WebNotificati onConstants.h"
19 19
20 namespace content { 20 namespace content {
21 21
22 const int64_t kNotificationId = 42; 22 const char kNotificationId[] = "my-notification";
23 const int64_t kServiceWorkerRegistrationId = 9001; 23 const int64_t kServiceWorkerRegistrationId = 9001;
24 24
25 const PlatformNotificationActionType kNotificationActionType = 25 const PlatformNotificationActionType kNotificationActionType =
26 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT; 26 PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT;
27 const char kOrigin[] = "https://example.com/"; 27 const char kOrigin[] = "https://example.com/";
28 const char kNotificationTitle[] = "My Notification"; 28 const char kNotificationTitle[] = "My Notification";
29 const char kNotificationLang[] = "nl"; 29 const char kNotificationLang[] = "nl";
30 const char kNotificationBody[] = "Hello, world!"; 30 const char kNotificationBody[] = "Hello, world!";
31 const char kNotificationTag[] = "my_tag"; 31 const char kNotificationTag[] = "my_tag";
32 const char kNotificationImageUrl[] = "https://example.com/image.jpg"; 32 const char kNotificationImageUrl[] = "https://example.com/image.jpg";
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 SerializeNotificationDatabaseData(database_data, &serialized_data)); 205 SerializeNotificationDatabaseData(database_data, &serialized_data));
206 206
207 NotificationDatabaseData copied_data; 207 NotificationDatabaseData copied_data;
208 ASSERT_TRUE( 208 ASSERT_TRUE(
209 DeserializeNotificationDatabaseData(serialized_data, &copied_data)); 209 DeserializeNotificationDatabaseData(serialized_data, &copied_data));
210 210
211 EXPECT_TRUE(copied_data.notification_data.actions[0].placeholder.is_null()); 211 EXPECT_TRUE(copied_data.notification_data.actions[0].placeholder.is_null());
212 } 212 }
213 213
214 } // namespace content 214 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698