Chromium Code Reviews| Index: content/browser/service_worker/service_worker_job_unittest.cc |
| diff --git a/content/browser/service_worker/service_worker_job_unittest.cc b/content/browser/service_worker/service_worker_job_unittest.cc |
| index 5938ee6512dd697ba26e800dece652090df6533b..c49fe8184044b881e98f637f77b5d8d132430025 100644 |
| --- a/content/browser/service_worker/service_worker_job_unittest.cc |
| +++ b/content/browser/service_worker/service_worker_job_unittest.cc |
| @@ -183,7 +183,7 @@ scoped_refptr<ServiceWorkerRegistration> ServiceWorkerJobTest::RunRegisterJob( |
| scoped_refptr<ServiceWorkerRegistration> registration; |
| bool called; |
| job_coordinator()->Register( |
| - pattern, script_url, NULL, |
| + script_url, ServiceWorkerRegistrationOptions(pattern), nullptr, |
| SaveRegistration(expected_status, &called, ®istration)); |
| EXPECT_FALSE(called); |
| base::RunLoop().RunUntilIdle(); |
| @@ -277,16 +277,16 @@ TEST_F(ServiceWorkerJobTest, DifferentMatchDifferentRegistration) { |
| bool called1; |
| scoped_refptr<ServiceWorkerRegistration> original_registration1; |
| job_coordinator()->Register( |
| - GURL("http://www.example.com/one/"), |
| GURL("http://www.example.com/service_worker.js"), |
| + ServiceWorkerRegistrationOptions(GURL("http://www.example.com/one/")), |
| NULL, |
| SaveRegistration(SERVICE_WORKER_OK, &called1, &original_registration1)); |
| bool called2; |
| scoped_refptr<ServiceWorkerRegistration> original_registration2; |
| job_coordinator()->Register( |
| - GURL("http://www.example.com/two/"), |
| GURL("http://www.example.com/service_worker.js"), |
| + ServiceWorkerRegistrationOptions(GURL("http://www.example.com/two/")), |
| NULL, |
| SaveRegistration(SERVICE_WORKER_OK, &called2, &original_registration2)); |
| @@ -468,9 +468,7 @@ TEST_F(ServiceWorkerJobTest, ParallelRegUnreg) { |
| bool registration_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url, |
| - NULL, |
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL, |
| SaveRegistration(SERVICE_WORKER_OK, ®istration_called, ®istration)); |
| bool unregistration_called = false; |
| @@ -500,21 +498,17 @@ TEST_F(ServiceWorkerJobTest, ParallelRegNewScript) { |
| bool registration1_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration1; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url1, |
| - NULL, |
| - SaveRegistration( |
| - SERVICE_WORKER_OK, ®istration1_called, ®istration1)); |
| + script_url1, ServiceWorkerRegistrationOptions(pattern), NULL, |
| + SaveRegistration(SERVICE_WORKER_OK, ®istration1_called, |
| + ®istration1)); |
| GURL script_url2("http://www.example.com/service_worker2.js"); |
| bool registration2_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration2; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url2, |
| - NULL, |
| - SaveRegistration( |
| - SERVICE_WORKER_OK, ®istration2_called, ®istration2)); |
| + script_url2, ServiceWorkerRegistrationOptions(pattern), NULL, |
| + SaveRegistration(SERVICE_WORKER_OK, ®istration2_called, |
| + ®istration2)); |
| ASSERT_FALSE(registration1_called); |
| ASSERT_FALSE(registration2_called); |
| @@ -538,20 +532,16 @@ TEST_F(ServiceWorkerJobTest, ParallelRegSameScript) { |
| bool registration1_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration1; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url, |
| - NULL, |
| - SaveRegistration( |
| - SERVICE_WORKER_OK, ®istration1_called, ®istration1)); |
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL, |
| + SaveRegistration(SERVICE_WORKER_OK, ®istration1_called, |
| + ®istration1)); |
| bool registration2_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration2; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url, |
| - NULL, |
| - SaveRegistration( |
| - SERVICE_WORKER_OK, ®istration2_called, ®istration2)); |
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL, |
| + SaveRegistration(SERVICE_WORKER_OK, ®istration2_called, |
| + ®istration2)); |
| ASSERT_FALSE(registration1_called); |
| ASSERT_FALSE(registration2_called); |
| @@ -608,20 +598,16 @@ TEST_F(ServiceWorkerJobTest, AbortAll_Register) { |
| bool registration_called1 = false; |
| scoped_refptr<ServiceWorkerRegistration> registration1; |
| job_coordinator()->Register( |
| - pattern1, |
| - script_url1, |
| - NULL, |
| - SaveRegistration(SERVICE_WORKER_ERROR_ABORT, |
| - ®istration_called1, ®istration1)); |
| + script_url1, ServiceWorkerRegistrationOptions(pattern1), NULL, |
| + SaveRegistration(SERVICE_WORKER_ERROR_ABORT, ®istration_called1, |
| + ®istration1)); |
| bool registration_called2 = false; |
| scoped_refptr<ServiceWorkerRegistration> registration2; |
| job_coordinator()->Register( |
| - pattern2, |
| - script_url2, |
| - NULL, |
| - SaveRegistration(SERVICE_WORKER_ERROR_ABORT, |
| - ®istration_called2, ®istration2)); |
| + script_url2, ServiceWorkerRegistrationOptions(pattern2), NULL, |
| + SaveRegistration(SERVICE_WORKER_ERROR_ABORT, ®istration_called2, |
| + ®istration2)); |
| ASSERT_FALSE(registration_called1); |
| ASSERT_FALSE(registration_called2); |
| @@ -683,11 +669,9 @@ TEST_F(ServiceWorkerJobTest, AbortAll_RegUnreg) { |
| bool registration_called = false; |
| scoped_refptr<ServiceWorkerRegistration> registration; |
| job_coordinator()->Register( |
| - pattern, |
| - script_url, |
| - NULL, |
| - SaveRegistration(SERVICE_WORKER_ERROR_ABORT, |
| - ®istration_called, ®istration)); |
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL, |
| + SaveRegistration(SERVICE_WORKER_ERROR_ABORT, ®istration_called, |
| + ®istration)); |
| bool unregistration_called = false; |
| job_coordinator()->Unregister( |
| @@ -882,9 +866,8 @@ class UpdateJobTestHelper |
| scoped_refptr<ServiceWorkerRegistration> registration; |
| bool called = false; |
| job_coordinator()->Register( |
| - test_origin.Resolve(kScope), |
| test_origin.Resolve(kScript), |
| - NULL, |
| + ServiceWorkerRegistrationOptions(test_origin.Resolve(kScope)), NULL, |
|
falken
2017/07/07 03:25:32
optional nit: if you like you can just s/NULL/null
yuryu
2017/07/10 03:38:10
Done.
|
| SaveRegistration(SERVICE_WORKER_OK, &called, ®istration)); |
| base::RunLoop().RunUntilIdle(); |
| EXPECT_TRUE(called); |