Index: LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get-response-type-blob.html |
diff --git a/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get.html b/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get-response-type-blob.html |
similarity index 55% |
copy from LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get.html |
copy to LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get-response-type-blob.html |
index 7a026c3c2bef6dfe047f5a78c5a725c67594386e..191946944ebf4b054c7b747e7911251e1d889350 100644 |
--- a/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get.html |
+++ b/LayoutTests/http/tests/xmlhttprequest/cross-origin-preflight-get-response-type-blob.html |
@@ -1,6 +1,6 @@ |
<html> |
<body> |
-<p>The "Origin" header must be sent with a "non-simple" cross-origin resource sharing request that uses the GET method.</p> |
+<p>The "Origin" header must be sent with a "non-simple" cross-origin resource sharing request that uses the GET method and specifies "blob" as response type.</p> |
<pre id="console"></pre> |
<script> |
if (window.testRunner) { |
@@ -10,21 +10,29 @@ if (window.testRunner) { |
function log(message) |
{ |
- document.getElementById('console').appendChild(document.createTextNode(message + '\n')); |
+ document.getElementById("console").appendChild(document.createTextNode(message + "\n")); |
} |
function test() |
{ |
var xhr = new XMLHttpRequest(); |
+ xhr.responseType = "blob"; |
xhr.open("GET", "http://localhost:8000/xmlhttprequest/resources/cross-origin-preflight-get.php", true); |
// Make this a "non-simple" cross-origin request by adding a custom header. |
xhr.setRequestHeader("X-Proprietary-Header", "foo"); |
xhr.onerror = function() { log("onerror") } |
xhr.onload = function() { |
- log(xhr.responseText); |
- if (window.testRunner) |
- testRunner.notifyDone(); |
+ var reader = new FileReader; |
+ reader.onload = function(evt) { |
+ log(evt.target.result); |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ }; |
+ reader.onerror = function () { |
+ log("reader.onerror"); |
+ } |
+ reader.readAsText(xhr.response); |
} |
xhr.send(null); |
} |