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 d83152d006e2633be5855ee75e553c9656c5cdf1..927788c1b1c7500d4113aa0a0f2f0b806b8d118a 100644 |
--- a/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc |
+++ b/content/browser/service_worker/foreign_fetch_request_handler_unittest.cc |
@@ -171,17 +171,6 @@ 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 = |
@@ -204,7 +193,16 @@ class ForeignFetchRequestHandlerTest : public testing::Test { |
base::Bind(&ServiceWorkerUtils::NoOpStatusCallback)); |
base::RunLoop().RunUntilIdle(); |
- provider_host_->running_hosted_version_ = version; |
+ 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)); |
} |
private: |