Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html

Issue 76133002: XHR: reset error flag on aborting request that restarts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!doctype html>
2 <html>
3 <body>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
9
10 function log(str)
11 {
12 document.body.appendChild(document.createTextNode(str));
13 document.body.appendChild(document.createElement("br"));
14 }
15
16 function addElement(e)
17 {
18 var txt = (e && e.type) || "insertedText";
19 log(txt);
20 }
21 document.addEventListener("DOMContentLoaded", addElement, false);
22
23 var abortDispatched = false;
24 function reportResult()
25 {
26 log(abortDispatched ? "PASS" : "FAIL");
27 testRunner.notifyDone();
28 }
29
30 window.onload = function () {
31 xhr.open("GET", "", true);
32 setTimeout(reportResult, 100);
33 };
34
35 var xhr = new XMLHttpRequest();
36 xhr.onabort = function () {
37 abortDispatched = true;
38 };
39
40 function sendAndAbort()
41 {
42 xhr.open("GET", "", true);
43 xhr.send();
44 xhr.abort();
45 }
46 window.addEventListener("DOMSubtreeModified", sendAndAbort);
47 addElement();
48 </script>
49 Reentrancy, cancellation and explicit abort. Check that we don't crash
50 and report the expected abort event.<br/>
51 </body>
52 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698