| Index: content/browser/service_worker/service_worker_context_unittest.cc
|
| diff --git a/content/browser/service_worker/service_worker_context_unittest.cc b/content/browser/service_worker/service_worker_context_unittest.cc
|
| index 6f36f034a304706cf8895c02feaf4cc3259adf53..9bd818b958571253c62d69ce394f956750a0e999 100644
|
| --- a/content/browser/service_worker/service_worker_context_unittest.cc
|
| +++ b/content/browser/service_worker/service_worker_context_unittest.cc
|
| @@ -79,6 +79,9 @@ void ExpectRegisteredWorkers(
|
| } else {
|
| EXPECT_FALSE(registration->active_version());
|
| }
|
| +
|
| + EXPECT_EQ(blink::WebServiceWorkerUpdateViaCache::kImports,
|
| + registration->update_via_cache());
|
| }
|
|
|
| class RejectInstallTestHelper : public EmbeddedWorkerTestHelper {
|
| @@ -210,9 +213,7 @@ TEST_F(ServiceWorkerContextTest, Register) {
|
| int64_t registration_id = kInvalidServiceWorkerRegistrationId;
|
| bool called = false;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -265,9 +266,7 @@ TEST_F(ServiceWorkerContextTest, Register_RejectInstall) {
|
| int64_t registration_id = kInvalidServiceWorkerRegistrationId;
|
| bool called = false;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -317,7 +316,7 @@ TEST_F(ServiceWorkerContextTest, Register_RejectActivate) {
|
| int64_t registration_id = kInvalidServiceWorkerRegistrationId;
|
| bool called = false;
|
| context()->RegisterServiceWorker(
|
| - pattern, script_url, NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -356,9 +355,8 @@ TEST_F(ServiceWorkerContextTest, Unregister) {
|
| bool called = false;
|
| int64_t registration_id = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| GURL("http://www.example.com/service_worker.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -405,24 +403,20 @@ TEST_F(ServiceWorkerContextTest, UnregisterMultiple) {
|
| int64_t registration_id3 = kInvalidServiceWorkerRegistrationId;
|
| int64_t registration_id4 = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - origin1_p1,
|
| GURL("http://www.example.com/service_worker.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(origin1_p1), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id1));
|
| context()->RegisterServiceWorker(
|
| - origin1_p2,
|
| GURL("http://www.example.com/service_worker2.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(origin1_p2), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id2));
|
| context()->RegisterServiceWorker(
|
| - origin2_p1,
|
| GURL("http://www.example.com:8080/service_worker3.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(origin2_p1), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id3));
|
| context()->RegisterServiceWorker(
|
| - origin3_p1,
|
| GURL("http://www.other.com/service_worker4.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(origin3_p1), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id4));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -502,9 +496,8 @@ TEST_F(ServiceWorkerContextTest, RegisterNewScript) {
|
| bool called = false;
|
| int64_t old_registration_id = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| GURL("http://www.example.com/service_worker.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, &old_registration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -515,9 +508,8 @@ TEST_F(ServiceWorkerContextTest, RegisterNewScript) {
|
| called = false;
|
| int64_t new_registration_id = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| GURL("http://www.example.com/service_worker_new.js"),
|
| - NULL,
|
| + ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, &new_registration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -545,9 +537,7 @@ TEST_F(ServiceWorkerContextTest, RegisterDuplicateScript) {
|
| bool called = false;
|
| int64_t old_registration_id = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, &old_registration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -558,9 +548,7 @@ TEST_F(ServiceWorkerContextTest, RegisterDuplicateScript) {
|
| called = false;
|
| int64_t new_registration_id = kInvalidServiceWorkerRegistrationId;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, &new_registration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -690,9 +678,7 @@ TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) {
|
| int64_t registration_id = kInvalidServiceWorkerRegistrationId;
|
| bool called = false;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
| @@ -735,9 +721,7 @@ TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) {
|
|
|
| called = false;
|
| context()->RegisterServiceWorker(
|
| - pattern,
|
| - script_url,
|
| - NULL,
|
| + script_url, ServiceWorkerRegistrationOptions(pattern), NULL,
|
| MakeRegisteredCallback(&called, ®istration_id));
|
|
|
| ASSERT_FALSE(called);
|
|
|