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 <stdint.h> | 5 #include <stdint.h> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 bool success, | 73 bool success, |
74 const std::vector<NotificationDatabaseData>& notification_datas) { | 74 const std::vector<NotificationDatabaseData>& notification_datas) { |
75 DCHECK(store_notification_datas); | 75 DCHECK(store_notification_datas); |
76 | 76 |
77 success_ = success; | 77 success_ = success; |
78 *store_notification_datas = notification_datas; | 78 *store_notification_datas = notification_datas; |
79 } | 79 } |
80 | 80 |
81 protected: | 81 protected: |
82 // Creates a new PlatformNotificationContextImpl instance. When using this | 82 // Creates a new PlatformNotificationContextImpl instance. When using this |
83 // method, the underlying database will always be created in memory. The | 83 // method, the underlying database will always be created in memory. |
84 // current message loop proxy will be used as the task runner. | |
85 PlatformNotificationContextImpl* CreatePlatformNotificationContext() { | 84 PlatformNotificationContextImpl* CreatePlatformNotificationContext() { |
86 PlatformNotificationContextImpl* context = | 85 PlatformNotificationContextImpl* context = |
87 new PlatformNotificationContextImpl(base::FilePath(), &browser_context_, | 86 new PlatformNotificationContextImpl(base::FilePath(), &browser_context_, |
88 nullptr); | 87 nullptr); |
89 context->Initialize(); | 88 context->Initialize(); |
90 | 89 |
91 OverrideTaskRunnerForTesting(context); | 90 OverrideTaskRunnerForTesting(context); |
92 return context; | 91 return context; |
93 } | 92 } |
94 | 93 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 ASSERT_EQ(10u, notification_database_datas.size()); | 413 ASSERT_EQ(10u, notification_database_datas.size()); |
415 | 414 |
416 for (int i = 0; i < 10; ++i) { | 415 for (int i = 0; i < 10; ++i) { |
417 EXPECT_EQ(origin, notification_database_datas[i].origin); | 416 EXPECT_EQ(origin, notification_database_datas[i].origin); |
418 EXPECT_EQ(kFakeServiceWorkerRegistrationId, | 417 EXPECT_EQ(kFakeServiceWorkerRegistrationId, |
419 notification_database_datas[i].service_worker_registration_id); | 418 notification_database_datas[i].service_worker_registration_id); |
420 } | 419 } |
421 } | 420 } |
422 | 421 |
423 } // namespace content | 422 } // namespace content |
OLD | NEW |