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 1a49d8bc99a4354c31a417d87e74ffcc721c700a..30cd3ef8dd58934bf9c8751e0b2f686ab78b776e 100644 |
--- a/content/browser/service_worker/service_worker_context_unittest.cc |
+++ b/content/browser/service_worker/service_worker_context_unittest.cc |
@@ -79,6 +79,8 @@ void ExpectRegisteredWorkers( |
} else { |
EXPECT_FALSE(registration->active_version()); |
} |
+ |
+ EXPECT_FALSE(registration->use_cache()); |
} |
class RejectInstallTestHelper : public EmbeddedWorkerTestHelper { |
@@ -208,9 +210,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); |
@@ -264,9 +264,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 +315,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); |
@@ -357,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); |
@@ -406,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); |
@@ -503,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); |
@@ -516,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); |
@@ -546,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); |
@@ -559,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); |
@@ -686,9 +673,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); |
@@ -731,9 +716,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); |