Revision bca58b0cef32b342eece2c135fdc62e32b69e557 authored by moz-wptsync-bot on 16 March 2018, 13:38:52 UTC, committed by moz-wptsync-bot on 20 March 2018, 02:29:46 UTC
bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1445883
gecko-commit: 0f81334efa0a008db8931a41eef2d26a77d0e800
gecko-integration-branch: mozilla-inbound
gecko-reviewers: smaug
1 parent c51eaff
Raw File
interfaces.html
<!doctype html>
<meta charset=utf-8>
<title>XMLHttpRequest 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>

<h1>XMLHttpRequest IDL tests</h1>
<div id=log></div>

<script type=text/plain class=untested>
[TreatNonCallableAsNull]
callback EventHandlerNonNull = any (Event event);
typedef EventHandlerNonNull? EventHandler;
</script>
<script>
"use strict";
var form = document.createElement("form");
var idlArray = new IdlArray();

function doTest([domIdl, xhrIdl]) {
  idlArray.add_untested_idls(domIdl);
  var untestedIdl = document.querySelector("script.untested").textContent;
  idlArray.add_untested_idls(untestedIdl);
  idlArray.add_idls(xhrIdl);
  idlArray.add_objects({
    XMLHttpRequest: ['new XMLHttpRequest()'],
    XMLHttpRequestUpload: ['(new XMLHttpRequest()).upload'],
    FormData: ['new FormData()', 'new FormData(form)']
  });
  idlArray.test();
}

function fetchText(url) {
  return fetch(url).then(response => response.text());
}

promise_test(() => {
  return Promise.all(["/interfaces/dom.idl",
                      "/interfaces/xhr.idl"].map(fetchText))
    .then(doTest);
}, "Test driver");
</script>
back to top