| 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 62%
|
| 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..6d35b5cda226a85ace904274cc06addb0dfce951 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) {
|
| @@ -17,14 +17,22 @@ function log(message)
|
| 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);
|
| }
|
|
|