1 description("Test that XHR.responseType = 'blob' gives you back a Blob.");
4 testRunner.waitUntilDone();
6 function testBlob(blobURL, blobType, doneFunction) {
7 window.xhr = new XMLHttpRequest();
8 xhr.open("GET", blobURL);
9 xhr.responseType = "blob";
10 shouldBeEqualToString("xhr.responseType", "blob");
12 xhr.onreadystatechange = function() {
13 if (xhr.readyState != 4) {
14 shouldBeNull("xhr.response");
17 shouldBeTrue("xhr.response instanceof Blob");
18 shouldBeEqualToString("xhr.response.type", blobType);
23 testBlob("resources/UTF8.txt", "text/plain", function() {
24 testBlob("resources/does_not_exist.txt", "", function() {
25 testBlob("resources/empty-file", "", function() {
26 if (window.testRunner)
27 testRunner.notifyDone();