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

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

Issue 2779763004: Create ServiceWorkerProviderHost before starting worker (Closed)
Patch Set: Pass the param of BindWithProviderInfo by value instead of pointer 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 e77c68d9517028742911f3d5173f06adc8a90dbd..e019f1934d52f4ae3f787728effa0cd07f1c99ba 100644
--- a/content/browser/service_worker/link_header_support_unittest.cc
+++ b/content/browser/service_worker/link_header_support_unittest.cc
@@ -106,17 +106,6 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
}
void CreateServiceWorkerProviderHost() {
- remote_endpoints_.emplace_back();
- std::unique_ptr<ServiceWorkerProviderHost> host =
- CreateProviderHostForServiceWorkerContext(
- 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());
@@ -124,7 +113,15 @@ class LinkHeaderServiceWorkerTest : public ::testing::Test {
registration.get(), GURL("https://host/script.js"), 1L,
context()->AsWeakPtr());
- provider_host_->running_hosted_version_ = version;
+ 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());
+ provider_host_ = host->AsWeakPtr();
+ EXPECT_FALSE(
+ context()->GetProviderHost(host->process_id(), host->provider_id()));
+ context()->AddProviderHost(std::move(host));
}
std::unique_ptr<net::URLRequest> CreateRequest(const GURL& request_url,

Powered by Google App Engine
This is Rietveld 408576698