Files
firefox/testing/web-platform/tests/payment-request/idlharness.https.window.js
Philip Jägenstedt ccc6dbe599 Bug 1488351 [wpt PR 12821] - Sync Payment Request IDL with spec, a=testonly
Automatic update from web-platform-testsSync Payment Request IDL with spec (#12821)

* Update interfaces/payment-request.idl

Source: https://github.com/tidoust/reffy-reports/blob/398ec92/whatwg/idl/payment-request.idl
Build: https://travis-ci.org/tidoust/reffy-reports/builds/423853333

* Update payment-request/idlharness.https.window.js

--

wpt-commits: 70b8ec865d913a46efacd351d0ad4669f6847a91
wpt-pr: 12821
2018-09-10 10:11:51 +00:00

32 lines
975 B
JavaScript

// META: script=/resources/WebIDLParser.js
// META: script=/resources/idlharness.js
'use strict';
// https://w3c.github.io/payment-request/
idl_test(
['payment-request'],
['dom', 'html'],
idlArray => {
try {
const methods = [
{supportedMethods: 'basic-card'},
{supportedMethods: 'https://apple.com/apple-pay'},
];
const amount = {currency: 'USD', value: '0'};
const details = {total: {label: 'label', amount: amount} };
window.paymentRequest = new PaymentRequest(methods, details);
} catch (e) {
// Surfaced below when paymentRequest is undefined.
}
idlArray.add_objects({
PaymentRequest: ['paymentRequest'],
PaymentMethodChangeEvent: ['new PaymentMethodChangeEvent("paymentmethodchange")'],
PaymentRequestUpdateEvent: ['new PaymentRequestUpdateEvent("paymentrequestupdate")'],
MerchantValidationEvent: ['new MerchantValidationEvent("merchantvalidation")'],
});
}
);