| 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 8efd35bfe905ccf84af85ff5c9238c7f73c56c03..a8ee102eb270e59f2f2a5c0d2f3ff9b91906093f 100644
|
| --- a/content/browser/service_worker/embedded_worker_test_helper.h
|
| +++ b/content/browser/service_worker/embedded_worker_test_helper.h
|
| @@ -10,7 +10,9 @@
|
| #include <vector>
|
|
|
| #include "base/callback.h"
|
| +#include "base/containers/scoped_ptr_hash_map.h"
|
| #include "base/memory/weak_ptr.h"
|
| +#include "content/common/mojo/service_registry_impl.h"
|
| #include "ipc/ipc_listener.h"
|
| #include "ipc/ipc_test_sink.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -96,6 +98,10 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
|
| int embedded_worker_id,
|
| const IPC::Message& message);
|
|
|
| + // Called to setup mojo for a new embedded worker. Override to register
|
| + // services the worker should expose to the browser.
|
| + virtual void OnSetupMojo(ServiceRegistry* service_registry);
|
| +
|
| // On*Event handlers. Called by the default implementation of
|
| // OnMessageToWorker when events are sent to the embedded
|
| // worker. By default they just return success via
|
| @@ -123,6 +129,8 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
|
| EmbeddedWorkerRegistry* registry();
|
|
|
| private:
|
| + class MockEmbeddedWorkerSetup;
|
| +
|
| void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params);
|
| void OnStopWorkerStub(int embedded_worker_id);
|
| void OnMessageToWorkerStub(int thread_id,
|
| @@ -133,6 +141,9 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
|
| void OnFetchEventStub(int request_id,
|
| const ServiceWorkerFetchRequest& request);
|
| void OnPushEventStub(int request_id, const std::string& data);
|
| + void OnSetupMojoStub(int thread_id,
|
| + mojo::InterfaceRequest<mojo::ServiceProvider> services,
|
| + mojo::ServiceProviderPtr exposed_services);
|
|
|
| MessagePortMessageFilter* NewMessagePortMessageFilter();
|
|
|
| @@ -147,8 +158,15 @@ class EmbeddedWorkerTestHelper : public IPC::Sender,
|
| int next_thread_id_;
|
| int mock_render_process_id_;
|
|
|
| + ServiceRegistryImpl render_process_service_registry_;
|
| +
|
| std::map<int, int64> embedded_worker_id_service_worker_version_id_map_;
|
|
|
| + // Stores the ServiceRegistries that are associated with each individual
|
| + // service worker.
|
| + base::ScopedPtrHashMap<int, scoped_ptr<ServiceRegistryImpl>>
|
| + thread_id_service_registry_map_;
|
| +
|
| // Updated each time MessageToWorker message is received.
|
| int current_embedded_worker_id_;
|
|
|
|
|