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

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

Issue 521363002: Make XHR use the background HTML parser (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: register before finish Created 6 years, 3 months 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 <script src="/js-test-resources/js-test.js"></script> 2 <script src="/js-test-resources/js-test.js"></script>
3 <script> 3 <script>
4 jsTestIsAsync = true; 4 jsTestIsAsync = true;
5 5
6 var xhr = new XMLHttpRequest(); 6 function testXHRAbortForURI(uri, testDone) {
7 xhr.responseType = 'document'; 7 debug("Start testing for URI: " + uri);
8 xhr.onreadystatechange = function () {
9 if (this.readyState == XMLHttpRequest.LOADING) {
10 xhr.abort();
11 requestAnimationFrame(function() {
12 debug("PASS if no crash or leak.");
13 testRunner.notifyDone();
14 });
15 }
16 };
17 8
18 xhr.open("GET", "resources/small-chunks.cgi", true); 9 var xhr = new XMLHttpRequest();
19 xhr.send(null); 10 xhr.responseType = 'document';
11 xhr.onreadystatechange = function () {
12 if (this.readyState == XMLHttpRequest.LOADING) {
13 xhr.abort();
14 debug("Aborted XHR during LOADING state.");
15 requestAnimationFrame(testDone);
16 }
17 };
18
19 xhr.open("GET", uri, true);
20 xhr.send(null);
21 }
22
23 testXHRAbortForURI("resources/small-chunks.cgi", function() {
24 testXHRAbortForURI("resources/xml-small-chunks.cgi", function() {
25 debug("PASS if no crash or leak.");
26 finishJSTest();
27 });
28 });
29
20 </script> 30 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698