| 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 0d235ec0b3461f666ec53a2d4398b6570c7d4637..5dd2e34ca40f2af65e54f11f5b0a813f6b348888 100644
|
| --- a/content/browser/service_worker/service_worker_job_unittest.cc
|
| +++ b/content/browser/service_worker/service_worker_job_unittest.cc
|
| @@ -162,7 +162,7 @@ scoped_refptr<ServiceWorkerRegistration> ServiceWorkerJobTest::RunRegisterJob(
|
| scoped_refptr<ServiceWorkerRegistration> registration;
|
| bool called;
|
| job_coordinator()->Register(
|
| - pattern, script_url, NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| SaveRegistration(expected_status, &called, ®istration));
|
| EXPECT_FALSE(called);
|
| base::RunLoop().RunUntilIdle();
|
| @@ -254,16 +254,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));
|
|
|
| @@ -411,9 +411,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;
|
| @@ -443,21 +441,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);
|
| @@ -481,20 +475,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);
|
| @@ -551,20 +541,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);
|
| @@ -626,11 +612,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(
|
| @@ -825,9 +809,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,
|
| SaveRegistration(SERVICE_WORKER_OK, &called, ®istration));
|
| base::RunLoop().RunUntilIdle();
|
| EXPECT_TRUE(called);
|
|
|