Chromium Code Reviews| Index: LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html |
| diff --git a/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html b/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9fae2b0db424061333d05d0b8ac12c9ecee4d1b4 |
| --- /dev/null |
| +++ b/LayoutTests/http/tests/xmlhttprequest/response-blob-mimetype.html |
| @@ -0,0 +1,40 @@ |
| +<!DOCTYPE html> |
| +<body> |
| + |
| +<script src="/js-test-resources/js-test.js"></script> |
| + |
| +<script> |
| +description('This tests that XMLHttpRequest lowers the MIME Type when creates a response blob.'); |
| +window.jsTestIsAsync = true; |
| + |
| + |
|
tyoshino (SeeGerritForStatus)
2015/02/09 05:39:45
1 blank line
|
| +function get(url) { |
| + return new Promise(function(resolve, reject) { |
| + var xhr = new XMLHttpRequest(); |
| + var blob = new Blob(['Test Content']); |
| + xhr.responseType = 'blob'; |
| + xhr.open('GET', url, true); |
| + xhr.onreadystatechange = function() { |
| + if (xhr.readyState === 4) { |
| + resolve(xhr); |
| + } |
| + } |
| + xhr.send(blob); |
| + }); |
| +} |
| + |
| +get('/dom/resources/send-mime-type.php?m=MULTIPART/MIXED').then(function(xhr) { |
| + returnedMimeType = xhr.response.type; |
| + shouldBeEqualToString("returnedMimeType", "multipart/mixed"); |
| + |
| + return get('/dom/resources/send-mime-type.php?m=Text/Plain'); |
| +}).then(function(xhr) { |
| + returnedMimeType = xhr.response.type; |
| + shouldBeEqualToString("returnedMimeType", "text/plain"); |
| + |
|
tyoshino (SeeGerritForStatus)
2015/02/09 05:39:45
remove this blank line
|
| +}).catch(function(reason) { |
| + testFailed(String(reason)); |
| +}).then(finishJSTest, finishJSTest); |
| + |
| +</script> |
| +</body> |