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

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

Issue 2933793002: ServiceWorker: keep dispatcher hosts for unittests in the test helper (Closed)
Patch Set: RegisterMockDispatcherHost -> RegisterDispatcherHost 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
« no previous file with comments | « content/browser/service_worker/service_worker_handle_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8bd2ee2181b3793c4b84417ae229904ac7d8a862..3b074ddec2a06721138b54073b4989119b29106b 100644
--- a/content/browser/service_worker/service_worker_version_unittest.cc
+++ b/content/browser/service_worker/service_worker_version_unittest.cc
@@ -18,6 +18,7 @@
#include "content/browser/service_worker/embedded_worker_status.h"
#include "content/browser/service_worker/embedded_worker_test_helper.h"
#include "content/browser/service_worker/service_worker_context_core.h"
+#include "content/browser/service_worker/service_worker_dispatcher_host.h"
#include "content/browser/service_worker/service_worker_registration.h"
#include "content/browser/service_worker/service_worker_test_utils.h"
#include "content/common/service_worker/service_worker_utils.h"
@@ -1109,9 +1110,9 @@ TEST_F(ServiceWorkerFailToStartTest, RendererCrash) {
EXPECT_EQ(SERVICE_WORKER_ERROR_NETWORK, status);
EXPECT_EQ(EmbeddedWorkerStatus::STARTING, version_->running_status());
- // Simulate renderer crash: do what
+ // Simulate renderer crash: remove DispatcherHost like what
// ServiceWorkerDispatcherHost::OnFilterRemoved does.
- helper_->context()->RemoveDispatcherHost(helper_->mock_render_process_id());
+ helper_->RegisterDispatcherHost(helper_->mock_render_process_id(), nullptr);
base::RunLoop().RunUntilIdle();
// Callback completed.
@@ -1319,9 +1320,9 @@ TEST_F(ServiceWorkerVersionTest, RendererCrashDuringEvent) {
// Callback has not completed yet.
EXPECT_EQ(SERVICE_WORKER_OK, status);
- // Simulate renderer crash: do what
+ // Simulate renderer crash: remove DispatcherHost like what
// ServiceWorkerDispatcherHost::OnFilterRemoved does.
- helper_->context()->RemoveDispatcherHost(helper_->mock_render_process_id());
+ helper_->RegisterDispatcherHost(helper_->mock_render_process_id(), nullptr);
base::RunLoop().RunUntilIdle();
// Callback completed.
« no previous file with comments | « content/browser/service_worker/service_worker_handle_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698