| <!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; |
| |
| 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"); |
| }).catch(function(reason) { |
| testFailed(String(reason)); |
| }).then(finishJSTest, finishJSTest); |
| |
| </script> |
| </body> |