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

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

Issue 2771823002: Implement updateViaCache flag and no-cache by default for main service worker scripts
Patch Set: fix tests Created 3 years, 9 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_browsertest.cc
diff --git a/content/browser/service_worker/service_worker_browsertest.cc b/content/browser/service_worker/service_worker_browsertest.cc
index ec881bf8f475aef479df7fccceb6d3d6f647dfab..ab31838c73b96d66104e81d7350efe2ae0873e91 100644
--- a/content/browser/service_worker/service_worker_browsertest.cc
+++ b/content/browser/service_worker/service_worker_browsertest.cc
@@ -571,7 +571,7 @@ class ServiceWorkerVersionBrowserTest : public ServiceWorkerBrowserTest {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO));
const GURL pattern = embedded_test_server()->GetURL("/service_worker/");
registration_ = new ServiceWorkerRegistration(
- pattern,
+ pattern, false /* use_cache */,
wrapper()->context()->storage()->NewRegistrationId(),
wrapper()->context()->AsWeakPtr());
// Set the update check time to avoid triggering updates in the middle of
@@ -1308,7 +1308,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, FetchPageWithSaveData) {
observer->Init();
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -1350,7 +1350,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, CrossOriginFetchWithSaveData) {
observer->Init();
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -1393,7 +1393,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -1419,7 +1419,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest, Reload) {
observer->Init();
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -1493,7 +1493,7 @@ class ServiceWorkerNavigationPreloadTest : public ServiceWorkerBrowserTest {
observer->Init();
public_context()->RegisterServiceWorker(
- scope, worker_url,
+ scope, worker_url, false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
}
@@ -2203,8 +2203,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
new WorkerActivatedObserver(wrapper());
observer->Init();
public_context()->RegisterServiceWorker(
- https_server.GetURL(kPageUrl),
- https_server.GetURL(kWorkerUrl),
+ https_server.GetURL(kPageUrl), https_server.GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -2240,7 +2239,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBrowserTest,
observer->Init();
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
@@ -2353,7 +2352,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
base::RunLoop run_loop;
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kScope),
- embedded_test_server()->GetURL("/does/not/exist"),
+ embedded_test_server()->GetURL("/does/not/exist"), false,
base::Bind(&ExpectResultAndRun, false, run_loop.QuitClosure()));
run_loop.Run();
}
@@ -2364,7 +2363,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
base::RunLoop run_loop;
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kScope),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure()));
run_loop.Run();
}
@@ -2376,7 +2375,7 @@ IN_PROC_BROWSER_TEST_F(ServiceWorkerBlackBoxBrowserTest, Registration) {
base::RunLoop run_loop;
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kScope),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, run_loop.QuitClosure()));
run_loop.Run();
}
@@ -2685,7 +2684,7 @@ class ServiceWorkerV8CacheStrategiesTest : public ServiceWorkerBrowserTest {
observer->Init();
public_context()->RegisterServiceWorker(
embedded_test_server()->GetURL(kPageUrl),
- embedded_test_server()->GetURL(kWorkerUrl),
+ embedded_test_server()->GetURL(kWorkerUrl), false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
}
@@ -2824,6 +2823,7 @@ class ServiceWorkerDisableWebSecurityTest : public ServiceWorkerBrowserTest {
observer->Init();
public_context()->RegisterServiceWorker(
cross_origin_server_.GetURL(scope), cross_origin_server_.GetURL(script),
+ false,
base::Bind(&ExpectResultAndRun, true, base::Bind(&base::DoNothing)));
observer->Wait();
}

Powered by Google App Engine
This is Rietveld 408576698