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

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

Issue 2958753003: Revert "Create ServiceWorkerProviderHost before starting worker" (Closed)
Patch Set: 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/link_header_support_unittest.cc
diff --git a/content/browser/service_worker/link_header_support_unittest.cc b/content/browser/service_worker/link_header_support_unittest.cc
index e019f1934d52f4ae3f787728effa0cd07f1c99ba..e77c68d9517028742911f3d5173f06adc8a90dbd 100644
--- a/content/browser/service_worker/link_header_support_unittest.cc
+++ b/content/browser/service_worker/link_header_support_unittest.cc
@@ -106,22 +106,25 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
}
void CreateServiceWorkerProviderHost() {
- scoped_refptr<ServiceWorkerRegistration> registration =
- new ServiceWorkerRegistration(GURL("https://host/scope"), 1L,
- context()->AsWeakPtr());
- scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
- registration.get(), GURL("https://host/script.js"), 1L,
- context()->AsWeakPtr());
-
remote_endpoints_.emplace_back();
std::unique_ptr<ServiceWorkerProviderHost> host =
CreateProviderHostForServiceWorkerContext(
- render_process_id(), true /* is_parent_frame_secure */,
- version.get(), context()->AsWeakPtr(), &remote_endpoints_.back());
+ render_process_id(), kMockProviderId,
+ true /* is_parent_frame_secure */, context()->AsWeakPtr(),
+ &remote_endpoints_.back());
provider_host_ = host->AsWeakPtr();
EXPECT_FALSE(
context()->GetProviderHost(host->process_id(), host->provider_id()));
context()->AddProviderHost(std::move(host));
+
+ scoped_refptr<ServiceWorkerRegistration> registration =
+ new ServiceWorkerRegistration(GURL("https://host/scope"), 1L,
+ context()->AsWeakPtr());
+ scoped_refptr<ServiceWorkerVersion> version = new ServiceWorkerVersion(
+ registration.get(), GURL("https://host/script.js"), 1L,
+ context()->AsWeakPtr());
+
+ provider_host_->running_hosted_version_ = version;
}
std::unique_ptr<net::URLRequest> CreateRequest(const GURL& request_url,

Powered by Google App Engine
This is Rietveld 408576698