| Index: third_party/WebKit/LayoutTests/http/tests/payments/resources/payment-request-event.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/payments/resources/payment-request-event.js b/third_party/WebKit/LayoutTests/http/tests/payments/resources/payment-request-event.js
|
| index addfad8ac606ffb16adc6fd3d316b541d428235c..986c07e5a4de222409caa4611a5411d33b5b6997 100644
|
| --- a/third_party/WebKit/LayoutTests/http/tests/payments/resources/payment-request-event.js
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/payments/resources/payment-request-event.js
|
| @@ -12,3 +12,46 @@ test(() => {
|
| assert_own_property(PaymentRequestEvent.prototype, 'instrumentKey');
|
| assert_own_property(PaymentRequestEvent.prototype, 'respondWith');
|
| });
|
| +
|
| +promise_test(() => {
|
| + return new Promise(resolve => {
|
| + var eventWithInit = new PaymentRequestEvent('paymentrequest', {
|
| + topLevelOrigin: 'https://example.com',
|
| + paymentRequestOrigin: 'https://example.com',
|
| + paymentRequestId: 'payment-request-id',
|
| + methodData: [{
|
| + supportedMethods: ['basic-card']
|
| + }],
|
| + total: {
|
| + label: 'Total',
|
| + amount: {
|
| + currency: 'USD',
|
| + value: '55.00'
|
| + }
|
| + },
|
| + modifiers: [{
|
| + supportedMethods: ['basic-card']
|
| + }],
|
| + instrumentKey: 'payment-instrument-key'
|
| + });
|
| +
|
| + self.addEventListener('paymentrequest', e => {
|
| + assert_equals(e.topLevelOrigin, 'https://example.com');
|
| + assert_equals(e.paymentRequestOrigin, 'https://example.com');
|
| + assert_equals(e.paymentRequestId, 'payment-request-id');
|
| + assert_equals(e.methodData.length, 1);
|
| + assert_equals(e.methodData[0].supportedMethods.length, 1);
|
| + assert_equals(e.methodData[0].supportedMethods[0], 'basic-card');
|
| + assert_equals(e.total.label, 'Total');
|
| + assert_equals(e.total.amount.currency, 'USD');
|
| + assert_equals(e.total.amount.value, '55.00');
|
| + assert_equals(e.modifiers.length, 1);
|
| + assert_equals(e.modifiers[0].supportedMethods.length, 1);
|
| + assert_equals(e.modifiers[0].supportedMethods[0], 'basic-card');
|
| + assert_equals(e.instrumentKey, 'payment-instrument-key');
|
| + resolve();
|
| + });
|
| +
|
| + self.dispatchEvent(eventWithInit);
|
| + });
|
| +});
|
|
|