Upstream version 5.34.92.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / http / tests / xmlhttprequest / reentrant-cancel.html
1 <!doctype html>
2 <html>
3 <body>
4 <script>
5 if (window.testRunner)
6     testRunner.dumpAsText();
7
8 function log(str)
9 {
10     document.body.appendChild(document.createTextNode(str));
11     document.body.appendChild(document.createElement("br"));
12 }
13
14 function addElement(e)
15 {
16     var txt = (e && e.type) || "insertedText";
17     log(txt);
18 }
19 document.addEventListener("DOMContentLoaded", addElement, false);
20 window.onload = addElement;
21
22 var xhr = new XMLHttpRequest;
23 function sendXHR()
24 {
25     xhr.open("GET", "", true);
26     xhr.send();
27 }
28 window.addEventListener("DOMSubtreeModified", sendXHR);
29 addElement();
30 </script>
31 This tests that when we re-entrantly create and cancel XHRs, we don't try to disconnect the same CachedResourceClient
32 multiple times from its CachedResource. We pass if we don't crash.<br/>
33 </body>
34 </html>
35