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

Unified Diff: content/browser/service_worker/embedded_worker_test_helper.h

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 | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/embedded_worker_test_helper.h
diff --git a/content/browser/service_worker/embedded_worker_test_helper.h b/content/browser/service_worker/embedded_worker_test_helper.h
index bb4f98b38aebf1f352f77fb77e8c6e50475b6aed..b94ffebb7bace031b23f346e9cf5a7610e86630c 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.h
+++ b/content/browser/service_worker/embedded_worker_test_helper.h
@@ -119,6 +119,16 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
void RegisterMockInstanceClient(
std::unique_ptr<MockEmbeddedWorkerInstanceClient> client);
+ // Registers the dispatcher host for the process to a map managed by this test
+ // helper. If there is a existing dispatcher host, it'll removed before adding
+ // to the map. This should be called before ServiceWorkerDispatcherHost::Init
+ // because it internally calls ServiceWorkerContextCore::AddDispatcherHost.
+ // If |dispatcher_host| is nullptr, this method just removes the existing
+ // dispatcher host from the map.
+ void RegisterDispatcherHost(
+ int process_id,
+ scoped_refptr<ServiceWorkerDispatcherHost> dispatcher_host);
+
template <typename MockType, typename... Args>
MockType* CreateAndRegisterMockInstanceClient(Args&&... args);
« no previous file with comments | « no previous file | content/browser/service_worker/embedded_worker_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698