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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 int request_id, | 96 int request_id, |
97 int active_version_id); | 97 int active_version_id); |
98 virtual void OnFetchEvent(int embedded_worker_id, | 98 virtual void OnFetchEvent(int embedded_worker_id, |
99 int request_id, | 99 int request_id, |
100 const ServiceWorkerFetchRequest& request); | 100 const ServiceWorkerFetchRequest& request); |
101 | 101 |
102 // These functions simulate sending an EmbeddedHostMsg message to the | 102 // These functions simulate sending an EmbeddedHostMsg message to the |
103 // browser. | 103 // browser. |
104 void SimulatePausedAfterDownload(int embedded_worker_id); | 104 void SimulatePausedAfterDownload(int embedded_worker_id); |
105 void SimulateWorkerReadyForInspection(int embedded_worker_id); | 105 void SimulateWorkerReadyForInspection(int embedded_worker_id); |
106 void SimulateWorkerScriptLoaded(int embedded_worker_id); | 106 void SimulateWorkerScriptLoaded(int thread_id, int embedded_worker_id); |
107 void SimulateWorkerStarted(int thread_id, int embedded_worker_id); | 107 void SimulateWorkerStarted(int embedded_worker_id); |
108 void SimulateWorkerStopped(int embedded_worker_id); | 108 void SimulateWorkerStopped(int embedded_worker_id); |
109 void SimulateSend(IPC::Message* message); | 109 void SimulateSend(IPC::Message* message); |
110 | 110 |
111 EmbeddedWorkerRegistry* registry(); | 111 EmbeddedWorkerRegistry* registry(); |
112 | 112 |
113 private: | 113 private: |
114 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params); | 114 void OnStartWorkerStub(const EmbeddedWorkerMsg_StartWorker_Params& params); |
115 void OnResumeAfterDownloadStub(int embedded_worker_id); | 115 void OnResumeAfterDownloadStub(int embedded_worker_id); |
116 void OnStopWorkerStub(int embedded_worker_id); | 116 void OnStopWorkerStub(int embedded_worker_id); |
117 void OnMessageToWorkerStub(int thread_id, | 117 void OnMessageToWorkerStub(int thread_id, |
(...skipping 16 matching lines...) Expand all Loading... |
134 int current_embedded_worker_id_; | 134 int current_embedded_worker_id_; |
135 | 135 |
136 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; | 136 base::WeakPtrFactory<EmbeddedWorkerTestHelper> weak_factory_; |
137 | 137 |
138 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); | 138 DISALLOW_COPY_AND_ASSIGN(EmbeddedWorkerTestHelper); |
139 }; | 139 }; |
140 | 140 |
141 } // namespace content | 141 } // namespace content |
142 | 142 |
143 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ | 143 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ |
OLD | NEW |