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

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: Remove content:: 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..81366ed7da4faf6a5f86523ce165248413bc7698 100644
--- a/content/browser/service_worker/embedded_worker_test_helper.h
+++ b/content/browser/service_worker/embedded_worker_test_helper.h
@@ -119,6 +119,14 @@ 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.
+ void RegisterMockDispatcherHost(
falken 2017/06/12 06:37:32 I think we don't need to say Mock since it takes a
shimazu 2017/06/12 06:51:08 I prefer saying Mock here because unittests should
falken 2017/06/12 07:08:20 I think it's confusing because all the other occur
shimazu 2017/06/12 08:04:07 I see, I agree with that.
+ 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