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

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

Issue 695943002: Reland "Prepare blink to unify definitions of load completion" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script> 4 <script>
5 if (window.testRunner) 5 if (window.testRunner) {
6 testRunner.dumpAsText(); 6 testRunner.dumpAsText();
7 testRunner.waitUntilDone();
8 }
7 9
8 function log(str) 10 function log(str)
9 { 11 {
10 document.body.appendChild(document.createTextNode(str)); 12 document.body.appendChild(document.createTextNode(str));
11 document.body.appendChild(document.createElement("br")); 13 document.body.appendChild(document.createElement("br"));
12 } 14 }
13 15
14 function addElement(e) 16 function addElement(e)
15 { 17 {
16 var txt = (e && e.type) || "insertedText"; 18 var txt = (e && e.type) || "insertedText";
17 log(txt); 19 log(txt);
18 } 20 }
19 document.addEventListener("DOMContentLoaded", addElement, false); 21 document.addEventListener("DOMContentLoaded", addElement, false);
20 window.onload = addElement; 22 window.onload = addElement;
21 23
22 var xhr = new XMLHttpRequest; 24 var xhr = new XMLHttpRequest;
23 function sendXHR() 25 function sendXHR()
24 { 26 {
25 xhr.open("GET", "", true); 27 xhr.open("GET", "", true);
28 xhr.onreadystatechange = function() {
29 if (xhr.readyState != 4)
30 return;
31 if (window.testRunner)
32 testRunner.notifyDone();
33 };
26 xhr.send(); 34 xhr.send();
27 } 35 }
28 window.addEventListener("DOMSubtreeModified", sendXHR); 36 window.addEventListener("DOMSubtreeModified", sendXHR);
29 addElement(); 37 addElement();
30 </script> 38 </script>
31 This tests that when we re-entrantly create and cancel XHRs, we don't try to dis connect the same CachedResourceClient 39 This tests that when we re-entrantly create and cancel XHRs, we don't try to dis connect the same CachedResourceClient
32 multiple times from its CachedResource. We pass if we don't crash.<br/> 40 multiple times from its CachedResource. We pass if we don't crash.<br/>
33 </body> 41 </body>
34 </html> 42 </html>
35 43
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698