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

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

Issue 501453002: Decouple script_url from ServiceWorkerRegistration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments and add unittests Created 6 years, 4 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 fa77f47d4d4dad331b0864aad6a950f2fd29181b..0ce1d4f5aeff7d10804195707c8b809a216a5a63 100644
--- a/content/browser/service_worker/service_worker_provider_host_unittest.cc
+++ b/content/browser/service_worker/service_worker_provider_host_unittest.cc
@@ -36,10 +36,9 @@ class ServiceWorkerProviderHostTest : public testing::Test {
scope_ = GURL("http://www.example.com/");
script_url_ = GURL("http://www.example.com/service_worker.js");
registration_ = new ServiceWorkerRegistration(
- scope_, script_url_, 1L, context_->AsWeakPtr());
+ scope_, 1L, context_->AsWeakPtr());
version_ = new ServiceWorkerVersion(
- registration_,
- 1L, context_->AsWeakPtr());
+ registration_, script_url_, 1L, context_->AsWeakPtr());
// Prepare provider hosts (for the same process).
scoped_ptr<ServiceWorkerProviderHost> host1(new ServiceWorkerProviderHost(
@@ -195,10 +194,10 @@ TEST_F(ServiceWorkerProviderHostTest,
VerifyVersionAttributes(provider_host1_, NULL, NULL, NULL);
VerifyVersionAttributes(provider_host2_, NULL, NULL, NULL);
- scoped_refptr<ServiceWorkerVersion> version1 =
- new ServiceWorkerVersion(registration_, 10L, context_->AsWeakPtr());
- scoped_refptr<ServiceWorkerVersion> version2 =
- new ServiceWorkerVersion(registration_, 20L, context_->AsWeakPtr());
+ scoped_refptr<ServiceWorkerVersion> version1 = new ServiceWorkerVersion(
+ registration_, script_url_, 10L, context_->AsWeakPtr());
+ scoped_refptr<ServiceWorkerVersion> version2 = new ServiceWorkerVersion(
+ registration_, script_url_, 20L, context_->AsWeakPtr());
registration_->SetInstallingVersion(version1);
VerifyVersionAttributes(provider_host1_, version1, NULL, NULL);

Powered by Google App Engine
This is Rietveld 408576698