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 | |
tyoshino (SeeGerritForStatus)
2015/02/09 05:39:45
1 blank line
| |
11 function get(url) { | |
12 return new Promise(function(resolve, reject) { | |
13 var xhr = new XMLHttpRequest(); | |
14 var blob = new Blob(['Test Content']); | |
15 xhr.responseType = 'blob'; | |
16 xhr.open('GET', url, true); | |
17 xhr.onreadystatechange = function() { | |
18 if (xhr.readyState === 4) { | |
19 resolve(xhr); | |
20 } | |
21 } | |
22 xhr.send(blob); | |
23 }); | |
24 } | |
25 | |
26 get('/dom/resources/send-mime-type.php?m=MULTIPART/MIXED').then(function(xhr) { | |
27 returnedMimeType = xhr.response.type; | |
28 shouldBeEqualToString("returnedMimeType", "multipart/mixed"); | |
29 | |
30 return get('/dom/resources/send-mime-type.php?m=Text/Plain'); | |
31 }).then(function(xhr) { | |
32 returnedMimeType = xhr.response.type; | |
33 shouldBeEqualToString("returnedMimeType", "text/plain"); | |
34 | |
tyoshino (SeeGerritForStatus)
2015/02/09 05:39:45
remove this blank line
| |
35 }).catch(function(reason) { | |
36 testFailed(String(reason)); | |
37 }).then(finishJSTest, finishJSTest); | |
38 | |
39 </script> | |
40 </body> | |
OLD | NEW |