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

Side by Side Diff: content/browser/service_worker/embedded_worker_test_helper.h

Issue 2610163002: PaymentApp: Implement InvokePaymentApp() in browser side. (Closed)
Patch Set: PaymentApp: Implement InvokePaymentApp() in content/browser side. Created 3 years, 11 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 unified diff | Download patch
OLDNEW
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>
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 DispatchExtendableMessageEventCallback& callback); 188 DispatchExtendableMessageEventCallback& callback);
189 virtual void OnInstallEvent(int embedded_worker_id, int request_id); 189 virtual void OnInstallEvent(int embedded_worker_id, int request_id);
190 virtual void OnFetchEvent(int embedded_worker_id, 190 virtual void OnFetchEvent(int embedded_worker_id,
191 int fetch_event_id, 191 int fetch_event_id,
192 const ServiceWorkerFetchRequest& request, 192 const ServiceWorkerFetchRequest& request,
193 mojom::FetchEventPreloadHandlePtr preload_handle, 193 mojom::FetchEventPreloadHandlePtr preload_handle,
194 const FetchCallback& callback); 194 const FetchCallback& callback);
195 virtual void OnPushEvent(int embedded_worker_id, 195 virtual void OnPushEvent(int embedded_worker_id,
196 int request_id, 196 int request_id,
197 const PushEventPayload& payload); 197 const PushEventPayload& payload);
198 virtual void OnPaymentRequestEvent(
199 payments::mojom::PaymentAppRequestDataPtr data,
200 const mojom::ServiceWorkerEventDispatcher::
201 DispatchPaymentRequestEventCallback& callback);
198 202
199 // These functions simulate sending an EmbeddedHostMsg message to the 203 // These functions simulate sending an EmbeddedHostMsg message to the
200 // browser. 204 // browser.
201 void SimulateWorkerReadyForInspection(int embedded_worker_id); 205 void SimulateWorkerReadyForInspection(int embedded_worker_id);
202 void SimulateWorkerScriptCached(int embedded_worker_id); 206 void SimulateWorkerScriptCached(int embedded_worker_id);
203 void SimulateWorkerScriptLoaded(int embedded_worker_id); 207 void SimulateWorkerScriptLoaded(int embedded_worker_id);
204 void SimulateWorkerThreadStarted(int thread_id, int embedded_worker_id); 208 void SimulateWorkerThreadStarted(int thread_id, int embedded_worker_id);
205 void SimulateWorkerScriptEvaluated(int embedded_worker_id, bool success); 209 void SimulateWorkerScriptEvaluated(int embedded_worker_id, bool success);
206 void SimulateWorkerStarted(int embedded_worker_id); 210 void SimulateWorkerStarted(int embedded_worker_id);
207 void SimulateWorkerStopped(int embedded_worker_id); 211 void SimulateWorkerStopped(int embedded_worker_id);
(...skipping 16 matching lines...) Expand all
224 mojom::ExtendableMessageEventPtr event, 228 mojom::ExtendableMessageEventPtr event,
225 const mojom::ServiceWorkerEventDispatcher:: 229 const mojom::ServiceWorkerEventDispatcher::
226 DispatchExtendableMessageEventCallback& callback); 230 DispatchExtendableMessageEventCallback& callback);
227 void OnInstallEventStub(int request_id); 231 void OnInstallEventStub(int request_id);
228 void OnFetchEventStub(int thread_id, 232 void OnFetchEventStub(int thread_id,
229 int fetch_event_id, 233 int fetch_event_id,
230 const ServiceWorkerFetchRequest& request, 234 const ServiceWorkerFetchRequest& request,
231 mojom::FetchEventPreloadHandlePtr preload_handle, 235 mojom::FetchEventPreloadHandlePtr preload_handle,
232 const FetchCallback& callback); 236 const FetchCallback& callback);
233 void OnPushEventStub(int request_id, const PushEventPayload& payload); 237 void OnPushEventStub(int request_id, const PushEventPayload& payload);
238 void OnPaymentRequestEventStub(
239 payments::mojom::PaymentAppRequestDataPtr data,
240 const mojom::ServiceWorkerEventDispatcher::
241 DispatchPaymentRequestEventCallback& callback);
234 242
235 MessagePortMessageFilter* NewMessagePortMessageFilter(); 243 MessagePortMessageFilter* NewMessagePortMessageFilter();
236 244
237 std::unique_ptr<service_manager::InterfaceRegistry> CreateInterfaceRegistry( 245 std::unique_ptr<service_manager::InterfaceRegistry> CreateInterfaceRegistry(
238 MockRenderProcessHost* rph); 246 MockRenderProcessHost* rph);
239 247
240 std::unique_ptr<TestBrowserContext> browser_context_; 248 std::unique_ptr<TestBrowserContext> browser_context_;
241 std::unique_ptr<MockRenderProcessHost> render_process_host_; 249 std::unique_ptr<MockRenderProcessHost> render_process_host_;
242 std::unique_ptr<MockRenderProcessHost> new_render_process_host_; 250 std::unique_ptr<MockRenderProcessHost> new_render_process_host_;
243 251
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 std::unique_ptr<MockType> mock = 288 std::unique_ptr<MockType> mock =
281 base::MakeUnique<MockType>(std::forward<Args>(args)...); 289 base::MakeUnique<MockType>(std::forward<Args>(args)...);
282 MockType* mock_rawptr = mock.get(); 290 MockType* mock_rawptr = mock.get();
283 RegisterMockInstanceClient(std::move(mock)); 291 RegisterMockInstanceClient(std::move(mock));
284 return mock_rawptr; 292 return mock_rawptr;
285 } 293 }
286 294
287 } // namespace content 295 } // namespace content
288 296
289 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_ 297 #endif // CONTENT_BROWSER_SERVICE_WORKER_EMBEDDED_WORKER_TEST_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698