Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /payment-request/historical.https.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset=utf-8>
<title>Historical Payment Request APIs</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script>
[
["paymentRequestID", "PaymentRequest"],
["paymentRequestID", "PaymentResponse"],
["careOf", "ContactAddress"],
["totalAmount", "PaymentResponse"],
["paymentRequestId", "PaymentRequest"],
["paymentRequestId", "PaymentResponse"],
["languageCode", "ContactAddress"],
["allowPaymentRequest", "HTMLIFrameElement"],
].forEach(([member, interf]) => {
test(() => {
assert_false(member in window[interf].prototype);
}, member + ' in ' + interf);
});
test(() => {
const methods = [];
const expectedError = {name: 'toString should be called'};
const unexpectedError = {name: 'sequence<DOMString> conversion is not allowed'};
methods.toString = () => { throw expectedError; };
Object.defineProperty(methods, '0', { get: () => { throw unexpectedError; } });
assert_throws_exactly(expectedError, () => {
new PaymentRequest([{supportedMethods: methods}], {total: {label: 'bar', amount: {currency: 'BAZ', value: '0'}}});
});
}, 'supportedMethods must not support sequence<DOMString>');
</script>