| OLD | NEW |
| 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 "content/browser/notifications/notification_database.h" | 5 #include "content/browser/notifications/notification_database.h" |
| 6 | 6 |
| 7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "content/public/browser/notification_database_data.h" | 10 #include "content/public/browser/notification_database_data.h" |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ASSERT_EQ(NotificationDatabase::STATUS_OK, | 310 ASSERT_EQ(NotificationDatabase::STATUS_OK, |
| 311 database->Open(true /* create_if_missing */)); | 311 database->Open(true /* create_if_missing */)); |
| 312 | 312 |
| 313 int64_t notification_id = 0; | 313 int64_t notification_id = 0; |
| 314 | 314 |
| 315 GURL origin("https://example.com"); | 315 GURL origin("https://example.com"); |
| 316 | 316 |
| 317 PlatformNotificationData notification_data; | 317 PlatformNotificationData notification_data; |
| 318 notification_data.title = base::UTF8ToUTF16("My Notification"); | 318 notification_data.title = base::UTF8ToUTF16("My Notification"); |
| 319 notification_data.direction = | 319 notification_data.direction = |
| 320 PlatformNotificationData::NotificationDirectionRightToLeft; | 320 PlatformNotificationData::DIRECTION_RIGHT_TO_LEFT; |
| 321 notification_data.lang = "nl-NL"; | 321 notification_data.lang = "nl-NL"; |
| 322 notification_data.body = base::UTF8ToUTF16("Hello, world!"); | 322 notification_data.body = base::UTF8ToUTF16("Hello, world!"); |
| 323 notification_data.tag = "replace id"; | 323 notification_data.tag = "replace id"; |
| 324 notification_data.icon = GURL("https://example.com/icon.png"); | 324 notification_data.icon = GURL("https://example.com/icon.png"); |
| 325 notification_data.silent = true; | 325 notification_data.silent = true; |
| 326 | 326 |
| 327 NotificationDatabaseData database_data; | 327 NotificationDatabaseData database_data; |
| 328 database_data.notification_id = notification_id; | 328 database_data.notification_id = notification_id; |
| 329 database_data.origin = origin; | 329 database_data.origin = origin; |
| 330 database_data.service_worker_registration_id = 42; | 330 database_data.service_worker_registration_id = 42; |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 std::vector<NotificationDatabaseData> notifications; | 584 std::vector<NotificationDatabaseData> notifications; |
| 585 ASSERT_EQ(NotificationDatabase::STATUS_OK, | 585 ASSERT_EQ(NotificationDatabase::STATUS_OK, |
| 586 database->ReadAllNotificationDataForServiceWorkerRegistration( | 586 database->ReadAllNotificationDataForServiceWorkerRegistration( |
| 587 origin, kExampleServiceWorkerRegistrationId, ¬ifications)); | 587 origin, kExampleServiceWorkerRegistrationId, ¬ifications)); |
| 588 | 588 |
| 589 EXPECT_EQ(0u, notifications.size()); | 589 EXPECT_EQ(0u, notifications.size()); |
| 590 } | 590 } |
| 591 | 591 |
| 592 } // namespace content | 592 } // namespace content |
| OLD | NEW |