summaryrefslogtreecommitdiffstats
path: root/dom/xhr/tests/xhr_worker_doubleSend.js
blob: 1ecf28e57ca34dc42875d3712937396b729ad5e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
var xhr = new XMLHttpRequest();
xhr.open("POST", "worker_testXHR.txt");
xhr.send();
try {
  xhr.send();
  postMessage("KO double send should fail");
} catch (e) {
  postMessage(
    e.name === "InvalidStateError" ? "OK" : "KO InvalidStateError expected"
  );
}