Index: content/browser/service_worker/service_worker_version_unittest.cc |
diff --git a/content/browser/service_worker/service_worker_version_unittest.cc b/content/browser/service_worker/service_worker_version_unittest.cc |
index 3b074ddec2a06721138b54073b4989119b29106b..0e91e7942064d716da275a1d44df61fdf6271457 100644 |
--- a/content/browser/service_worker/service_worker_version_unittest.cc |
+++ b/content/browser/service_worker/service_worker_version_unittest.cc |
@@ -270,14 +270,15 @@ class MessageReceiverDisallowStart : public MessageReceiver { |
enum class StartMode { STALL, FAIL, SUCCEED }; |
- void OnStartWorker(int embedded_worker_id, |
- int64_t service_worker_version_id, |
- const GURL& scope, |
- const GURL& script_url, |
- bool pause_after_download, |
- mojom::ServiceWorkerEventDispatcherRequest request, |
- mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo |
- instance_host) override { |
+ void OnStartWorker( |
+ int embedded_worker_id, |
+ int64_t service_worker_version_id, |
+ const GURL& scope, |
+ const GURL& script_url, |
+ bool pause_after_download, |
+ mojom::ServiceWorkerEventDispatcherRequest request, |
+ mojom::EmbeddedWorkerInstanceHostAssociatedPtrInfo instance_host, |
+ mojom::ServiceWorkerProviderClientInfoPtr provider_client_info) override { |
switch (mode_) { |
case StartMode::STALL: |
// Prepare for OnStopWorker(). |
@@ -296,7 +297,8 @@ class MessageReceiverDisallowStart : public MessageReceiver { |
case StartMode::SUCCEED: |
MessageReceiver::OnStartWorker( |
embedded_worker_id, service_worker_version_id, scope, script_url, |
- pause_after_download, std::move(request), std::move(instance_host)); |
+ pause_after_download, std::move(request), std::move(instance_host), |
+ std::move(provider_client_info)); |
break; |
} |
current_mock_instance_index_++; |
@@ -704,6 +706,11 @@ TEST_F(ServiceWorkerVersionTest, StoppingBeforeDestruct) { |
EXPECT_EQ(EmbeddedWorkerStatus::RUNNING, version_->running_status()); |
EXPECT_EQ(EmbeddedWorkerStatus::RUNNING, listener.last_status); |
+ // Release the reference to |version_|. |
+ // Hosting provider has the reference to the |version_|. |
+ helper_->context()->RemoveProviderHost( |
+ version_->provider_host()->process_id(), |
+ version_->provider_host()->provider_id()); |
version_ = nullptr; |
EXPECT_EQ(EmbeddedWorkerStatus::STOPPING, listener.last_status); |
} |