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

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler_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/foreign_fetch_request_handler_unittest.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc b/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc
index 927788c1b1c7500d4113aa0a0f2f0b806b8d118a..d83152d006e2633be5855ee75e553c9656c5cdf1 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc
@@ -171,6 +171,17 @@ class ForeignFetchRequestHandlerTest : public testing::Test {
}
void CreateServiceWorkerTypeProviderHost() {
+ remote_endpoints_.emplace_back();
+ std::unique_ptr<ServiceWorkerProviderHost> host =
+ CreateProviderHostForServiceWorkerContext(
+ helper_->mock_render_process_id(), kMockProviderId,
+ true /* is_parent_frame_secure */, helper_->context()->AsWeakPtr(),
+ &remote_endpoints_.back());
+ EXPECT_FALSE(
+ context()->GetProviderHost(host->process_id(), host->provider_id()));
+ provider_host_ = host->AsWeakPtr();
+ context()->AddProviderHost(std::move(host));
+
// Create another worker whose requests will be intercepted by the foreign
// fetch event handler.
scoped_refptr<ServiceWorkerRegistration> registration =
@@ -193,16 +204,7 @@ class ForeignFetchRequestHandlerTest : public testing::Test {
base::Bind(&ServiceWorkerUtils::NoOpStatusCallback));
base::RunLoop().RunUntilIdle();
- remote_endpoints_.emplace_back();
- std::unique_ptr<ServiceWorkerProviderHost> host =
- CreateProviderHostForServiceWorkerContext(
- helper_->mock_render_process_id(),
- true /* is_parent_frame_secure */, version.get(),
- helper_->context()->AsWeakPtr(), &remote_endpoints_.back());
- EXPECT_FALSE(
- context()->GetProviderHost(host->process_id(), host->provider_id()));
- provider_host_ = host->AsWeakPtr();
- context()->AddProviderHost(std::move(host));
+ provider_host_->running_hosted_version_ = version;
}
private:

Powered by Google App Engine
This is Rietveld 408576698