| Index: content/browser/service_worker/service_worker_storage_unittest.cc
|
| diff --git a/content/browser/service_worker/service_worker_storage_unittest.cc b/content/browser/service_worker/service_worker_storage_unittest.cc
|
| index 262ba79a1e26f38754462f91ce6fecb2fb3bf6ee..99ec4fac6483aed05f87c13898c4ccf7a4edb135 100644
|
| --- a/content/browser/service_worker/service_worker_storage_unittest.cc
|
| +++ b/content/browser/service_worker/service_worker_storage_unittest.cc
|
| @@ -578,8 +578,8 @@ TEST_F(ServiceWorkerStorageTest, DisabledStorage) {
|
| GetAllRegistrationsInfos(&all_registrations));
|
|
|
| scoped_refptr<ServiceWorkerRegistration> live_registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version = new ServiceWorkerVersion(
|
| live_registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
| EXPECT_EQ(SERVICE_WORKER_ERROR_ABORT,
|
| @@ -662,8 +662,8 @@ TEST_F(ServiceWorkerStorageTest, StoreFindUpdateDeleteRegistration) {
|
|
|
| // Store something.
|
| scoped_refptr<ServiceWorkerRegistration> live_registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version = new ServiceWorkerVersion(
|
| live_registration.get(), kResource1, kVersionId, context()->AsWeakPtr());
|
| live_version->set_fetch_handler_existence(
|
| @@ -790,7 +790,8 @@ TEST_F(ServiceWorkerStorageTest, StoreFindUpdateDeleteRegistration) {
|
|
|
| // Trying to update a unstored registration to active should fail.
|
| scoped_refptr<ServiceWorkerRegistration> unstored_registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId + 1,
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId + 1,
|
| context()->AsWeakPtr());
|
| EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND,
|
| UpdateToActiveState(unstored_registration));
|
| @@ -840,8 +841,8 @@ TEST_F(ServiceWorkerStorageTest, InstallingRegistrationsAreFindable) {
|
|
|
| // Create an unstored registration.
|
| scoped_refptr<ServiceWorkerRegistration> live_registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version = new ServiceWorkerVersion(
|
| live_registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
| live_version->SetStatus(ServiceWorkerVersion::INSTALLING);
|
| @@ -968,8 +969,8 @@ TEST_F(ServiceWorkerStorageTest, StoreUserData) {
|
|
|
| // Store a registration.
|
| scoped_refptr<ServiceWorkerRegistration> live_registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version = new ServiceWorkerVersion(
|
| live_registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records;
|
| @@ -1147,6 +1148,7 @@ class ServiceWorkerResourceStorageTest : public ServiceWorkerStorageTest {
|
| RegistrationData data;
|
| data.registration_id = registration_id_;
|
| data.scope = scope_;
|
| + data.use_cache = false;
|
| data.script = script_;
|
| data.version_id = version_id_;
|
| data.is_active = false;
|
| @@ -1622,8 +1624,8 @@ TEST_F(ServiceWorkerStorageTest, FindRegistration_LongestScopeMatch) {
|
| const int64_t kRegistrationId1 = 1;
|
| const int64_t kVersionId1 = 1;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration1 =
|
| - new ServiceWorkerRegistration(kScope1, kRegistrationId1,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope1, false /* use_cache */,
|
| + kRegistrationId1, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version1 = new ServiceWorkerVersion(
|
| live_registration1.get(), kScript1, kVersionId1, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records1;
|
| @@ -1641,8 +1643,8 @@ TEST_F(ServiceWorkerStorageTest, FindRegistration_LongestScopeMatch) {
|
| const int64_t kRegistrationId2 = 2;
|
| const int64_t kVersionId2 = 2;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration2 =
|
| - new ServiceWorkerRegistration(kScope2, kRegistrationId2,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope2, false /* use_cache */,
|
| + kRegistrationId2, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version2 = new ServiceWorkerVersion(
|
| live_registration2.get(), kScript2, kVersionId2, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records2;
|
| @@ -1660,8 +1662,8 @@ TEST_F(ServiceWorkerStorageTest, FindRegistration_LongestScopeMatch) {
|
| const int64_t kRegistrationId3 = 3;
|
| const int64_t kVersionId3 = 3;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration3 =
|
| - new ServiceWorkerRegistration(kScope3, kRegistrationId3,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope3, false /* use_cache */,
|
| + kRegistrationId3, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version3 = new ServiceWorkerVersion(
|
| live_registration3.get(), kScript3, kVersionId3, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records3;
|
| @@ -1725,8 +1727,8 @@ TEST_F(ServiceWorkerStorageDiskTest, OriginHasForeignFetchRegistrations) {
|
| const int64_t kRegistrationId1 = 1;
|
| const int64_t kVersionId1 = 1;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration1 =
|
| - new ServiceWorkerRegistration(kScope1, kRegistrationId1,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope1, false /* use_cache */,
|
| + kRegistrationId1, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version1 = new ServiceWorkerVersion(
|
| live_registration1.get(), kScript1, kVersionId1, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records1;
|
| @@ -1745,8 +1747,8 @@ TEST_F(ServiceWorkerStorageDiskTest, OriginHasForeignFetchRegistrations) {
|
| const int64_t kRegistrationId2 = 2;
|
| const int64_t kVersionId2 = 2;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration2 =
|
| - new ServiceWorkerRegistration(kScope2, kRegistrationId2,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope2, false /* use_cache */,
|
| + kRegistrationId2, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version2 = new ServiceWorkerVersion(
|
| live_registration2.get(), kScript2, kVersionId2, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records2;
|
| @@ -1765,8 +1767,8 @@ TEST_F(ServiceWorkerStorageDiskTest, OriginHasForeignFetchRegistrations) {
|
| const int64_t kRegistrationId3 = 3;
|
| const int64_t kVersionId3 = 3;
|
| scoped_refptr<ServiceWorkerRegistration> live_registration3 =
|
| - new ServiceWorkerRegistration(kScope3, kRegistrationId3,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope3, false /* use_cache */,
|
| + kRegistrationId3, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> live_version3 = new ServiceWorkerVersion(
|
| live_registration3.get(), kScript3, kVersionId3, context()->AsWeakPtr());
|
| std::vector<ServiceWorkerDatabase::ResourceRecord> records3;
|
| @@ -1918,8 +1920,8 @@ TEST_F(ServiceWorkerStorageOriginTrialsDiskTest, FromMainScript) {
|
| const int64_t kRegistrationId = 1;
|
| const int64_t kVersionId = 1;
|
| scoped_refptr<ServiceWorkerRegistration> registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
|
| registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
|
|
| @@ -2046,8 +2048,8 @@ TEST_F(ServiceWorkerStorageDiskTest, DisabledNavigationPreloadState) {
|
| const int64_t kRegistrationId = 1;
|
| const int64_t kVersionId = 1;
|
| scoped_refptr<ServiceWorkerRegistration> registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
|
| registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
|
|
| @@ -2092,8 +2094,8 @@ TEST_F(ServiceWorkerStorageDiskTest, EnabledNavigationPreloadState) {
|
| const int64_t kRegistrationId = 1;
|
| const int64_t kVersionId = 1;
|
| scoped_refptr<ServiceWorkerRegistration> registration =
|
| - new ServiceWorkerRegistration(kScope, kRegistrationId,
|
| - context()->AsWeakPtr());
|
| + new ServiceWorkerRegistration(kScope, false /* use_cache */,
|
| + kRegistrationId, context()->AsWeakPtr());
|
| scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
|
| registration.get(), kScript, kVersionId, context()->AsWeakPtr());
|
|
|
|
|