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> |