OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <body> |
| 3 |
| 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 |
| 6 <script> |
| 7 description('This tests that XMLHttpRequest lowers the MIME Type when creates a
response blob.'); |
| 8 window.jsTestIsAsync = true; |
| 9 |
| 10 function get(url) { |
| 11 return new Promise(function(resolve, reject) { |
| 12 var xhr = new XMLHttpRequest(); |
| 13 var blob = new Blob(['Test Content']); |
| 14 xhr.responseType = 'blob'; |
| 15 xhr.open('GET', url, true); |
| 16 xhr.onreadystatechange = function() { |
| 17 if (xhr.readyState === 4) { |
| 18 resolve(xhr); |
| 19 } |
| 20 } |
| 21 xhr.send(blob); |
| 22 }); |
| 23 } |
| 24 |
| 25 get('/dom/resources/send-mime-type.php?m=MULTIPART/MIXED').then(function(xhr) { |
| 26 returnedMimeType = xhr.response.type; |
| 27 shouldBeEqualToString("returnedMimeType", "multipart/mixed"); |
| 28 |
| 29 return get('/dom/resources/send-mime-type.php?m=Text/Plain'); |
| 30 }).then(function(xhr) { |
| 31 returnedMimeType = xhr.response.type; |
| 32 shouldBeEqualToString("returnedMimeType", "text/plain"); |
| 33 }).catch(function(reason) { |
| 34 testFailed(String(reason)); |
| 35 }).then(finishJSTest, finishJSTest); |
| 36 |
| 37 </script> |
| 38 </body> |
OLD | NEW |