OLD | NEW |
1 /* | 1 /* |
2 * payment-request-mock contains a mock implementation of PaymentRequest. | 2 * payment-request-mock contains a mock implementation of PaymentRequest. |
3 */ | 3 */ |
4 | 4 |
5 "use strict"; | 5 "use strict"; |
6 | 6 |
7 let paymentRequestMock = loadMojoModules( | 7 let paymentRequestMock = loadMojoModules( |
8 'paymentRequestMock', | 8 'paymentRequestMock', |
9 ['components/payments/content/payment_request.mojom', | 9 ['components/payments/mojom/payment_request.mojom', |
10 'mojo/public/js/bindings', | 10 'mojo/public/js/bindings', |
11 ]).then(mojo => { | 11 ]).then(mojo => { |
12 let [paymentRequest, bindings] = mojo.modules; | 12 let [paymentRequest, bindings] = mojo.modules; |
13 | 13 |
14 class PaymentRequestMock { | 14 class PaymentRequestMock { |
15 constructor(interfaceProvider) { | 15 constructor(interfaceProvider) { |
16 interfaceProvider.addInterfaceOverrideForTesting( | 16 interfaceProvider.addInterfaceOverrideForTesting( |
17 paymentRequest.PaymentRequest.name, | 17 paymentRequest.PaymentRequest.name, |
18 handle => this.bindings_.addBinding(this, handle)); | 18 handle => this.bindings_.addBinding(this, handle)); |
19 | 19 |
(...skipping 27 matching lines...) Expand all Loading... |
47 } | 47 } |
48 this.client_.onPaymentResponse(new paymentRequest.PaymentResponse(data)); | 48 this.client_.onPaymentResponse(new paymentRequest.PaymentResponse(data)); |
49 } | 49 } |
50 | 50 |
51 onComplete() { | 51 onComplete() { |
52 this.client_.onComplete(); | 52 this.client_.onComplete(); |
53 } | 53 } |
54 } | 54 } |
55 return new PaymentRequestMock(mojo.frameInterfaces); | 55 return new PaymentRequestMock(mojo.frameInterfaces); |
56 }); | 56 }); |
OLD | NEW |