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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort.html
diff --git a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort.html b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort.html
index 0f0b4f38b47aa270d1437e38b7f55764c44eb4af..bcf467539b4b1b24a295677167816b74a00ccc34 100644
--- a/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort.html
+++ b/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-responseXML-abort.html
@@ -3,18 +3,28 @@
<script>
jsTestIsAsync = true;
-var xhr = new XMLHttpRequest();
-xhr.responseType = 'document';
-xhr.onreadystatechange = function () {
- if (this.readyState == XMLHttpRequest.LOADING) {
- xhr.abort();
- requestAnimationFrame(function() {
- debug("PASS if no crash or leak.");
- testRunner.notifyDone();
- });
- }
-};
+function testXHRAbortForURI(uri, testDone) {
+ debug("Start testing for URI: " + uri);
+
+ var xhr = new XMLHttpRequest();
+ xhr.responseType = 'document';
+ xhr.onreadystatechange = function () {
+ if (this.readyState == XMLHttpRequest.LOADING) {
+ xhr.abort();
+ debug("Aborted XHR during LOADING state.");
+ requestAnimationFrame(testDone);
+ }
+ };
+
+ xhr.open("GET", uri, true);
+ xhr.send(null);
+}
+
+testXHRAbortForURI("resources/small-chunks.cgi", function() {
+ testXHRAbortForURI("resources/xml-small-chunks.cgi", function() {
+ debug("PASS if no crash or leak.");
+ finishJSTest();
+ });
+});
-xhr.open("GET", "resources/small-chunks.cgi", true);
-xhr.send(null);
</script>

Powered by Google App Engine
This is Rietveld 408576698