| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/callback.h" | 14 #include "base/callback.h" |
| 15 #include "base/containers/scoped_ptr_hash_map.h" | 15 #include "base/containers/scoped_ptr_hash_map.h" |
| 16 #include "base/macros.h" | 16 #include "base/macros.h" |
| 17 #include "base/memory/weak_ptr.h" | 17 #include "base/memory/weak_ptr.h" |
| 18 #include "content/common/mojo/service_registry_impl.h" | 18 #include "content/common/mojo/service_registry_impl.h" |
| 19 #include "ipc/ipc_listener.h" | 19 #include "ipc/ipc_listener.h" |
| 20 #include "ipc/ipc_test_sink.h" | 20 #include "ipc/ipc_test_sink.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 23 | 23 |
| 24 class GURL; | 24 class GURL; |
| 25 struct EmbeddedWorkerMsg_StartWorker_Params; | 25 struct EmbeddedWorkerMsg_StartWorker_Params; |
| 26 struct ServiceWorkerMsg_ExtendableMessageEvent_Params; | 26 struct ServiceWorkerMsg_ExtendableMessageEvent_Params; |
| 27 | 27 |
| 28 namespace shell { |
| 29 class InterfaceProvider; |
| 30 class InterfaceRegistry; |
| 31 } |
| 32 |
| 28 namespace content { | 33 namespace content { |
| 29 | 34 |
| 30 class EmbeddedWorkerRegistry; | 35 class EmbeddedWorkerRegistry; |
| 31 class EmbeddedWorkerTestHelper; | 36 class EmbeddedWorkerTestHelper; |
| 32 class MessagePortMessageFilter; | 37 class MessagePortMessageFilter; |
| 33 class MockRenderProcessHost; | 38 class MockRenderProcessHost; |
| 34 class ServiceWorkerContextCore; | 39 class ServiceWorkerContextCore; |
| 35 class ServiceWorkerContextWrapper; | 40 class ServiceWorkerContextWrapper; |
| 36 class TestBrowserContext; | 41 class TestBrowserContext; |
| 37 struct PushEventPayload; | 42 struct PushEventPayload; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 std::unique_ptr<MockRenderProcessHost> render_process_host_; | 177 std::unique_ptr<MockRenderProcessHost> render_process_host_; |
| 173 | 178 |
| 174 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; | 179 scoped_refptr<ServiceWorkerContextWrapper> wrapper_; |
| 175 | 180 |
| 176 IPC::TestSink sink_; | 181 IPC::TestSink sink_; |
| 177 IPC::TestSink inner_sink_; | 182 IPC::TestSink inner_sink_; |
| 178 | 183 |
| 179 int next_thread_id_; | 184 int next_thread_id_; |
| 180 int mock_render_process_id_; | 185 int mock_render_process_id_; |
| 181 | 186 |
| 182 ServiceRegistryImpl render_process_service_registry_; | 187 std::unique_ptr<shell::InterfaceRegistry> render_process_interface_registry_; |
| 183 | 188 |
| 184 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_; | 189 std::map<int, int64_t> embedded_worker_id_service_worker_version_id_map_; |
| 185 | 190 |
| 186 // Stores the ServiceRegistries that are associated with each individual | 191 // Stores the ServiceRegistries that are associated with each individual |
| 187 // service worker. | 192 // service worker. |
| 188 base::ScopedPtrHashMap<int, std::unique_ptr<ServiceRegistryImpl>> | 193 base::ScopedPtrHashMap<int, std::unique_ptr<ServiceRegistryImpl>> |
| 189 thread_id_service_registry_map_; | 194 thread_id_service_registry_map_; |
| 190 | 195 |
| 191 // Updated each time MessageToWorker message is received. | 196 // Updated each time MessageToWorker message is received. |
| 192 int current_embedded_worker_id_; | 197 int current_embedded_worker_id_; |
| 193 | 198 |
| 194 std::vector<scoped_refptr<MessagePortMessageFilter>> | 199 std::vector<scoped_refptr<MessagePortMessageFilter>> |
| 195 message_port_message_filters_; | 200 message_port_message_filters_; |
| 196 | 201 |
| 197 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; | 202 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; |
| 198 | 203 |
| 199 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); | 204 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); |
| 200 }; | 205 }; |
| 201 | 206 |
| 202 } // namespace content | 207 } // namespace content |
| 203 | 208 |
| 204 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 209 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
| OLD | NEW |