https://github.com/web-platform-tests/wpt
Raw File
Tip revision: a588436c16db4c8ae8644662124ff1af7e03f0d9 authored by Stephen McGruer on 03 April 2018, 21:32:18 UTC
Web Animations: Add test for Document::getAnimations across iframes
Tip revision: a588436
interfaces.https.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 urls =  ["/interfaces/dom.idl", "/interfaces/payment-request.idl"];
  const [dom, payment_request] = await Promise.all(
    urls.map(url => fetch(url).then(r => r.text())));
  const idlArray = new IdlArray();
  idlArray.add_untested_idls(dom);
  idlArray.add_idls(payment_request);

  // typedef EventHandler from HTML
  // https://html.spec.whatwg.org/#eventhandler
  idlArray.add_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>
back to top