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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host_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_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 0ebbc8213fcf1efb9e9d99eaad96be1abae0b7a6..be35f0cf0d89803c9ba5ced7f2fa90d20dbc693c 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