Chromium Code Reviews| Index: LayoutTests/http/tests/xmlhttprequest/resources/xmlhttprequest-response-type-blob.js |
| diff --git a/LayoutTests/http/tests/xmlhttprequest/resources/xmlhttprequest-response-type-blob.js b/LayoutTests/http/tests/xmlhttprequest/resources/xmlhttprequest-response-type-blob.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9f1b5f6446ee5dcf42245f62c1c1b9ca4d5672bd |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/xmlhttprequest/resources/xmlhttprequest-response-type-blob.js |
| @@ -0,0 +1,25 @@ |
| +var global = window; |
|
tyoshino (SeeGerritForStatus)
2013/09/24 10:28:31
is this to make it clear that variables are set to
yusukesuzuki
2013/09/24 11:13:39
It is because of reusing the following code of "wo
|
| + |
| +try { |
| + global.req = new XMLHttpRequest; |
| + req.responseType = 'blob'; |
| + req.open('GET', 'resources/get.txt', true); |
| + req.onreadystatechange = function() { |
| + if (req.readyState == 4) { |
| + shouldBe('req.status', '200'); |
| + shouldBe('req.response.size', '4'); |
| + var reader = new FileReader(); |
| + reader.onload = function (evt) { |
| + global.buffer = evt.target.result; |
| + shouldBeEqualToString('buffer', 'PASS'); |
| + testPassed('XHR with responseType="blob" succeeded'); |
| + finishJSTest(); |
| + }; |
| + reader.readAsText(req.response, 'utf-8'); |
| + } |
| + }; |
| + req.send(null); |
| +} catch (e) { |
| + testFailed('failed to create XMLHttpRequest with exception: ' + e.message); |
| + finishJSTest(); |
| +} |