Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7094)

Unified Diff: content/browser/service_worker/service_worker_context_unittest.cc

Issue 2968123002: Introduce ServiceWorkerRegistrationOptions struct for service worker options (Closed)
Patch Set: address more comments Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..e14f09e5d9ece965459f85df816717fb50531b88 100644
--- a/content/browser/service_worker/service_worker_context_unittest.cc
+++ b/content/browser/service_worker/service_worker_context_unittest.cc
@@ -210,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), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);
@@ -265,9 +263,7 @@ TEST_F(ServiceWorkerContextTest, Register_RejectInstall) {
int64_t registration_id = kInvalidServiceWorkerRegistrationId;
bool called = false;
context()->RegisterServiceWorker(
- pattern,
- script_url,
- NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);
@@ -317,7 +313,7 @@ TEST_F(ServiceWorkerContextTest, Register_RejectActivate) {
int64_t registration_id = kInvalidServiceWorkerRegistrationId;
bool called = false;
context()->RegisterServiceWorker(
- pattern, script_url, NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);
@@ -356,9 +352,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), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);
@@ -405,24 +400,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), nullptr,
MakeRegisteredCallback(&called, &registration_id1));
context()->RegisterServiceWorker(
- origin1_p2,
GURL("http://www.example.com/service_worker2.js"),
- NULL,
+ ServiceWorkerRegistrationOptions(origin1_p2), nullptr,
MakeRegisteredCallback(&called, &registration_id2));
context()->RegisterServiceWorker(
- origin2_p1,
GURL("http://www.example.com:8080/service_worker3.js"),
- NULL,
+ ServiceWorkerRegistrationOptions(origin2_p1), nullptr,
MakeRegisteredCallback(&called, &registration_id3));
context()->RegisterServiceWorker(
- origin3_p1,
GURL("http://www.other.com/service_worker4.js"),
- NULL,
+ ServiceWorkerRegistrationOptions(origin3_p1), nullptr,
MakeRegisteredCallback(&called, &registration_id4));
ASSERT_FALSE(called);
@@ -502,9 +493,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), nullptr,
MakeRegisteredCallback(&called, &old_registration_id));
ASSERT_FALSE(called);
@@ -515,9 +505,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), nullptr,
MakeRegisteredCallback(&called, &new_registration_id));
ASSERT_FALSE(called);
@@ -545,9 +534,7 @@ TEST_F(ServiceWorkerContextTest, RegisterDuplicateScript) {
bool called = false;
int64_t old_registration_id = kInvalidServiceWorkerRegistrationId;
context()->RegisterServiceWorker(
- pattern,
- script_url,
- NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &old_registration_id));
ASSERT_FALSE(called);
@@ -558,9 +545,7 @@ TEST_F(ServiceWorkerContextTest, RegisterDuplicateScript) {
called = false;
int64_t new_registration_id = kInvalidServiceWorkerRegistrationId;
context()->RegisterServiceWorker(
- pattern,
- script_url,
- NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &new_registration_id));
ASSERT_FALSE(called);
@@ -690,9 +675,7 @@ TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) {
int64_t registration_id = kInvalidServiceWorkerRegistrationId;
bool called = false;
context()->RegisterServiceWorker(
- pattern,
- script_url,
- NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);
@@ -735,9 +718,7 @@ TEST_P(ServiceWorkerContextRecoveryTest, DeleteAndStartOver) {
called = false;
context()->RegisterServiceWorker(
- pattern,
- script_url,
- NULL,
+ script_url, ServiceWorkerRegistrationOptions(pattern), nullptr,
MakeRegisteredCallback(&called, &registration_id));
ASSERT_FALSE(called);

Powered by Google App Engine
This is Rietveld 408576698