Chromium Code Reviews| 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 #include "content/browser/service_worker/embedded_worker_test_helper.h" | 5 #include "content/browser/service_worker/embedded_worker_test_helper.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 197 } | 197 } |
| 198 | 198 |
| 199 void DispatchSyncEvent( | 199 void DispatchSyncEvent( |
| 200 const std::string& tag, | 200 const std::string& tag, |
| 201 blink::mojom::BackgroundSyncEventLastChance last_chance, | 201 blink::mojom::BackgroundSyncEventLastChance last_chance, |
| 202 const DispatchSyncEventCallback& callback) override { | 202 const DispatchSyncEventCallback& callback) override { |
| 203 NOTIMPLEMENTED(); | 203 NOTIMPLEMENTED(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 void DispatchPaymentRequestEvent( | 206 void DispatchPaymentRequestEvent( |
| 207 int event_id, | |
|
shimazu
2017/03/08 01:39:39
|payment_response_id|
zino
2017/03/19 04:47:23
Done.
| |
| 207 payments::mojom::PaymentAppRequestPtr app_request, | 208 payments::mojom::PaymentAppRequestPtr app_request, |
| 209 mojom::PaymentAppResponseCallbackPtr response_callback, | |
| 208 const DispatchPaymentRequestEventCallback& callback) override { | 210 const DispatchPaymentRequestEventCallback& callback) override { |
| 209 if (!helper_) | 211 if (!helper_) |
| 210 return; | 212 return; |
| 211 helper_->OnPaymentRequestEventStub(std::move(app_request), callback); | 213 helper_->OnPaymentRequestEventStub(std::move(app_request), callback); |
| 212 } | 214 } |
| 213 | 215 |
| 214 void DispatchExtendableMessageEvent( | 216 void DispatchExtendableMessageEvent( |
| 215 mojom::ExtendableMessageEventPtr event, | 217 mojom::ExtendableMessageEventPtr event, |
| 216 const DispatchExtendableMessageEventCallback& callback) override { | 218 const DispatchExtendableMessageEventCallback& callback) override { |
| 217 if (!helper_) | 219 if (!helper_) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 439 const PlatformNotificationData& notification_data, | 441 const PlatformNotificationData& notification_data, |
| 440 const mojom::ServiceWorkerEventDispatcher:: | 442 const mojom::ServiceWorkerEventDispatcher:: |
| 441 DispatchNotificationCloseEventCallback& callback) { | 443 DispatchNotificationCloseEventCallback& callback) { |
| 442 callback.Run(SERVICE_WORKER_OK, base::Time::Now()); | 444 callback.Run(SERVICE_WORKER_OK, base::Time::Now()); |
| 443 } | 445 } |
| 444 | 446 |
| 445 void EmbeddedWorkerTestHelper::OnPaymentRequestEvent( | 447 void EmbeddedWorkerTestHelper::OnPaymentRequestEvent( |
| 446 payments::mojom::PaymentAppRequestPtr app_request, | 448 payments::mojom::PaymentAppRequestPtr app_request, |
| 447 const mojom::ServiceWorkerEventDispatcher:: | 449 const mojom::ServiceWorkerEventDispatcher:: |
| 448 DispatchPaymentRequestEventCallback& callback) { | 450 DispatchPaymentRequestEventCallback& callback) { |
| 449 callback.Run(SERVICE_WORKER_OK, base::Time::Now()); | 451 // callback.Run(SERVICE_WORKER_OK, base::Time::Now()); |
| 450 } | 452 } |
| 451 | 453 |
| 452 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( | 454 void EmbeddedWorkerTestHelper::SimulateWorkerReadyForInspection( |
| 453 int embedded_worker_id) { | 455 int embedded_worker_id) { |
| 454 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); | 456 EmbeddedWorkerInstance* worker = registry()->GetWorker(embedded_worker_id); |
| 455 ASSERT_TRUE(worker); | 457 ASSERT_TRUE(worker); |
| 456 registry()->OnWorkerReadyForInspection(worker->process_id(), | 458 registry()->OnWorkerReadyForInspection(worker->process_id(), |
| 457 embedded_worker_id); | 459 embedded_worker_id); |
| 458 } | 460 } |
| 459 | 461 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 661 service_manager::InterfaceProviderSpec()); | 663 service_manager::InterfaceProviderSpec()); |
| 662 | 664 |
| 663 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces( | 665 std::unique_ptr<service_manager::InterfaceProvider> remote_interfaces( |
| 664 new service_manager::InterfaceProvider); | 666 new service_manager::InterfaceProvider); |
| 665 remote_interfaces->Bind(std::move(interfaces)); | 667 remote_interfaces->Bind(std::move(interfaces)); |
| 666 rph->SetRemoteInterfaces(std::move(remote_interfaces)); | 668 rph->SetRemoteInterfaces(std::move(remote_interfaces)); |
| 667 return registry; | 669 return registry; |
| 668 } | 670 } |
| 669 | 671 |
| 670 } // namespace content | 672 } // namespace content |
| OLD | NEW |