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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 int request_id, | 100 int request_id, |
101 const ServiceWorkerFetchRequest& request); | 101 const ServiceWorkerFetchRequest& request); |
102 virtual void OnPushEvent(int embedded_worker_id, | 102 virtual void OnPushEvent(int embedded_worker_id, |
103 int request_id, | 103 int request_id, |
104 const std::string& data); | 104 const std::string& data); |
105 | 105 |
106 // These functions simulate sending an EmbeddedHostMsg message to the | 106 // These functions simulate sending an EmbeddedHostMsg message to the |
107 // browser. | 107 // browser. |
108 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 108 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
109 void SimulateWorkerScriptCached(int embedded_worker_id); | 109 void SimulateWorkerScriptCached(int embedded_worker_id); |
110 void SimulateWorkerScriptLoaded(int thread_id, int embedded_worker_id); | 110 void SimulateWorkerScriptLoaded(int embedded_worker_id); |
| 111 void SimulateWorkerThreadStarted(int thread_id, int embedded_worker_id); |
111 void SimulateWorkerScriptEvaluated(int embedded_worker_id); | 112 void SimulateWorkerScriptEvaluated(int embedded_worker_id); |
112 void SimulateWorkerStarted(int embedded_worker_id); | 113 void SimulateWorkerStarted(int embedded_worker_id); |
113 void SimulateWorkerStopped(int embedded_worker_id); | 114 void SimulateWorkerStopped(int embedded_worker_id); |
114 void SimulateSend(IPC::Message* message); | 115 void SimulateSend(IPC::Message* message); |
115 | 116 |
116 EmbeddedWorkerRegistry* registry(); | 117 EmbeddedWorkerRegistry* registry(); |
117 | 118 |
118 private: | 119 private: |
119 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params); | 120 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params); |
120 void OnStopWorkerStub(int embedded_worker_id); | 121 void OnStopWorkerStub(int embedded_worker_id); |
(...skipping 25 matching lines...) Expand all Loading... |
146 message_port_message_filters_; | 147 message_port_message_filters_; |
147 | 148 |
148 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; | 149 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; |
149 | 150 |
150 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); | 151 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); |
151 }; | 152 }; |
152 | 153 |
153 } // namespace content | 154 } // namespace content |
154 | 155 |
155 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 156 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
OLD | NEW |