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

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: change useCache to updateViaCache Created 3 years, 6 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 e2debc26b2ec9973ca0b7dc5c83d157bcc7c40c4..0a6d1018cd196704510b3a1d860497e0d30efbea 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_dispatcher_host_unittest.cc
@@ -169,8 +169,9 @@ class ServiceWorkerDispatcherHostTest : public testing::Test {
}
void SetUpRegistration(const GURL& scope, const GURL& script_url) {
- registration_ = new ServiceWorkerRegistration(
- scope, 1L, helper_->context()->AsWeakPtr());
+ registration_ =
+ new ServiceWorkerRegistration(ServiceWorkerRegistrationOptions(scope),
+ 1L, helper_->context()->AsWeakPtr());
version_ = new ServiceWorkerVersion(registration_.get(), script_url, 1L,
helper_->context()->AsWeakPtr());
std::vector<ServiceWorkerDatabase::ResourceRecord> records;
@@ -218,9 +219,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();
}
@@ -346,8 +348,9 @@ TEST_F(ServiceWorkerDispatcherHostTest,
// find it.
const int64_t kRegistrationId = 999; // Dummy value
scoped_refptr<ServiceWorkerRegistration> registration(
- new ServiceWorkerRegistration(GURL("https://www.example.com/"),
- kRegistrationId, context()->AsWeakPtr()));
+ new ServiceWorkerRegistration(
+ ServiceWorkerRegistrationOptions(GURL("https://www.example.com/")),
+ kRegistrationId, context()->AsWeakPtr()));
Unregister(kProviderId, kRegistrationId,
ServiceWorkerMsg_ServiceWorkerUnregistrationError::ID);

Powered by Google App Engine
This is Rietveld 408576698