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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host_unittest.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_dispatcher_host_unittest.cc
diff --git a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
index 0c3fdb678eea6b56ab493ca2eba85d61c9dd2b4d..864c9b1a778269e6f1ceb51db9e1985aacc4d23e 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
@@ -127,7 +127,7 @@ class ServiceWorkerDispatcherHostTest : public testing::Test {
void SetUpRegistration(const GURL& scope, const GURL& script_url) {
registration_ = new ServiceWorkerRegistration(
- scope, 1L, helper_->context()->AsWeakPtr());
+ scope, false /* use_cache */, 1L, helper_->context()->AsWeakPtr());
version_ = new ServiceWorkerVersion(registration_.get(), script_url, 1L,
helper_->context()->AsWeakPtr());
std::vector<ServiceWorkerDatabase::ResourceRecord> records;
@@ -173,9 +173,10 @@ class ServiceWorkerDispatcherHostTest : public testing::Test {
}
void SendRegister(int64_t provider_id, GURL pattern, GURL worker_url) {
+ ServiceWorkerRegistrationOptions options(pattern);
dispatcher_host_->OnMessageReceived(
- ServiceWorkerHostMsg_RegisterServiceWorker(
- -1, -1, provider_id, pattern, worker_url));
+ ServiceWorkerHostMsg_RegisterServiceWorker(-1, -1, provider_id,
+ worker_url, options));
base::RunLoop().RunUntilIdle();
}
@@ -301,7 +302,8 @@ TEST_F(ServiceWorkerDispatcherHostTest,
const int64_t kRegistrationId = 999; // Dummy value
scoped_refptr<ServiceWorkerRegistration> registration(
new ServiceWorkerRegistration(GURL("https://www.example.com/"),
- kRegistrationId, context()->AsWeakPtr()));
+ false /* use_cache */, kRegistrationId,
+ context()->AsWeakPtr()));
Unregister(kProviderId, kRegistrationId,
ServiceWorkerMsg_ServiceWorkerUnregistrationError::ID);

Powered by Google App Engine
This is Rietveld 408576698