mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-25 11:37:43 -10:00
31 lines
1.1 KiB
HTML
31 lines
1.1 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>Payment Request interface IDL tests</title>
|
|
<script src=/resources/testharness.js></script>
|
|
<script src=/resources/testharnessreport.js></script>
|
|
<script src=/resources/WebIDLParser.js></script>
|
|
<script src=/resources/idlharness.js></script>
|
|
<script>
|
|
promise_test(async () => {
|
|
const idlArray = new IdlArray();
|
|
const dom_idl = await fetch("/interfaces/dom.idl").then(r => r.text());
|
|
const pr_idl = await fetch("/interfaces/payment-request.idl").then(r => r.text());
|
|
idlArray.add_untested_idls(dom_idl);
|
|
idlArray.add_idls(pr_idl);
|
|
// typedef EventHandler from HTML
|
|
// https://html.spec.whatwg.org/#eventhandler
|
|
idlArray.add_untested_idls(`
|
|
[TreatNonObjectAsNull]
|
|
callback EventHandlerNonNull = any (Event event);
|
|
typedef EventHandlerNonNull? EventHandler;
|
|
`);
|
|
const methods = "[{supportedMethods: 'foo'}]";
|
|
const amount = "{currency: 'USD', value: '0'}";
|
|
const details = `{total: {label: 'bar', amount: ${amount}} }`;
|
|
idlArray.add_objects({
|
|
PaymentRequest: [`new PaymentRequest(${methods}, ${details})`],
|
|
});
|
|
idlArray.test();
|
|
}, "Setup for Payment Request API IDL tests.");
|
|
</script>
|