blob: ae8cd55dbe5f544ef95efcab044b6d81e75dcf45 [file] [log] [blame]
commit-queue@webkit.org6a003fd2014-10-14 17:10:24 +00001<!doctype html>
2<html>
3<body>
4<script>
5if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8}
9
10function log(str)
11{
12 document.body.appendChild(document.createTextNode(str));
13 document.body.appendChild(document.createElement("br"));
14}
15
16function addElement(e)
17{
18 var txt = (e && e.type) || "insertedText";
19 log(txt);
20}
21document.addEventListener("DOMContentLoaded", addElement, false);
22
23var abortDispatched = false;
24function reportResult()
25{
26 log(abortDispatched ? "PASS" : "FAIL");
27 testRunner.notifyDone();
28}
29
30window.onload = function () {
31 xhr.open("GET", "", true);
32 setTimeout(reportResult, 100);
33};
34
35var xhr = new XMLHttpRequest();
36xhr.onabort = function () {
37 abortDispatched = true;
38};
39
40function sendAndAbort()
41{
42 xhr.open("GET", "", true);
43 xhr.send();
44 xhr.abort();
45}
46window.addEventListener("DOMSubtreeModified", sendAndAbort);
47addElement();
48</script>
49Reentrancy, cancellation and explicit abort. Check that we don't crash
50and report the expected abort event.<br/>
51</body>
52</html>