summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/send-on-abort.html
blob: 727012bc2f3d12eef9f7f63cd1412fe2e336e7ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!-- https://bugs.webkit.org/show_bug.cgi?id=22672
     ASSERT(m_table) when xhr.onabort creates another xhr or calls setTimeout
-->
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function abortHandler()
{
    xhr2 = new XMLHttpRequest;
    setTimeout("alert('FAAAIL!')", 100);
}

function onreadystatechangeHandler()
{
    if (xhr.readyState == 4)
        abortHandler();
}

xhr = new XMLHttpRequest;
xhr.onabort = abortHandler;
xhr.onreadystatechange = onreadystatechangeHandler;
xhr.open("GET", "foo.txt", true); 
xhr.send(null);
location.href = "data:text/html,<script>if (window.testRunner) testRunner.notifyDone()</scr" + "ipt>PASS: No assertion failure.";
</script>