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

Unified Diff: content/browser/service_worker/service_worker_provider_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_provider_host_unittest.cc
diff --git a/content/browser/service_worker/service_worker_provider_host_unittest.cc b/content/browser/service_worker/service_worker_provider_host_unittest.cc
index 8e1029b513b25234859f71788495c0f6a940e804..f4325c138c3f1bdcd40d684df425ebdf297a2d76 100644
--- a/content/browser/service_worker/service_worker_provider_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
@@ -57,11 +57,15 @@ class ServiceWorkerProviderHostTest : public testing::Test {
context_ = helper_->context();
script_url_ = GURL("https://www.example.com/service_worker.js");
registration1_ = new ServiceWorkerRegistration(
- GURL("https://www.example.com/"), 1L, context_->AsWeakPtr());
+ ServiceWorkerRegistrationOptions(GURL("https://www.example.com/")), 1L,
+ context_->AsWeakPtr());
registration2_ = new ServiceWorkerRegistration(
- GURL("https://www.example.com/example"), 2L, context_->AsWeakPtr());
+ ServiceWorkerRegistrationOptions(
+ GURL("https://www.example.com/example")),
+ 2L, context_->AsWeakPtr());
registration3_ = new ServiceWorkerRegistration(
- GURL("https://other.example.com/"), 3L, context_->AsWeakPtr());
+ ServiceWorkerRegistrationOptions(GURL("https://other.example.com/")),
+ 3L, context_->AsWeakPtr());
}
void TearDown() override {
@@ -248,10 +252,10 @@ TEST_F(ServiceWorkerProviderHostTest, ContextSecurity) {
class MockServiceWorkerRegistration : public ServiceWorkerRegistration {
public:
- MockServiceWorkerRegistration(const GURL& pattern,
+ MockServiceWorkerRegistration(const ServiceWorkerRegistrationOptions& options,
int64_t registration_id,
base::WeakPtr<ServiceWorkerContextCore> context)
- : ServiceWorkerRegistration(pattern, registration_id, context) {}
+ : ServiceWorkerRegistration(options, registration_id, context) {}
void AddListener(ServiceWorkerRegistration::Listener* listener) override {
listeners_.insert(listener);
@@ -278,8 +282,9 @@ TEST_F(ServiceWorkerProviderHostTest, CrossSiteTransfer) {
// Create a mock registration before creating the provider host which is in
// the scope.
+ ServiceWorkerRegistrationOptions options(GURL("https://cross.example.com/"));
scoped_refptr<MockServiceWorkerRegistration> registration =
- new MockServiceWorkerRegistration(GURL("https://cross.example.com/"), 4L,
+ new MockServiceWorkerRegistration(options, 4L,
helper_->context()->AsWeakPtr());
ServiceWorkerProviderHost* provider_host =

Powered by Google App Engine
This is Rietveld 408576698