historical.https.html (1603B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>Historical Payment Request APIs</title> 4 <script src=/resources/testharness.js></script> 5 <script src=/resources/testharnessreport.js></script> 6 <script> 7 [ 8 // https://github.com/w3c/browser-payment-api/pull/419 9 ["paymentRequestID", "PaymentRequest"], 10 ["paymentRequestID", "PaymentResponse"], 11 12 // https://github.com/w3c/browser-payment-api/pull/258 13 ["careOf", "ContactAddress"], 14 15 // https://github.com/w3c/browser-payment-api/pull/219 16 ["totalAmount", "PaymentResponse"], 17 18 // https://github.com/w3c/browser-payment-api/pull/426 19 ["paymentRequestId", "PaymentRequest"], 20 ["paymentRequestId", "PaymentResponse"], 21 22 // https://github.com/w3c/payment-request/pull/765 23 ["languageCode", "ContactAddress"], 24 25 //https://github.com/whatwg/html/pull/5915 26 ["allowPaymentRequest", "HTMLIFrameElement"], 27 28 ].forEach(([member, interf]) => { 29 test(() => { 30 assert_false(member in window[interf].prototype); 31 }, member + ' in ' + interf); 32 }); 33 34 // https://github.com/w3c/payment-request/pull/551 35 test(() => { 36 const methods = []; 37 const expectedError = {name: 'toString should be called'}; 38 const unexpectedError = {name: 'sequence<DOMString> conversion is not allowed'}; 39 methods.toString = () => { throw expectedError; }; 40 Object.defineProperty(methods, '0', { get: () => { throw unexpectedError; } }); 41 assert_throws_exactly(expectedError, () => { 42 new PaymentRequest([{supportedMethods: methods}], {total: {label: 'bar', amount: {currency: 'BAZ', value: '0'}}}); 43 }); 44 }, 'supportedMethods must not support sequence<DOMString>'); 45 </script>