OLD | NEW |
1 <html> | 1 <html> |
2 <body> | 2 <body> |
3 <div id="description"></div> | 3 <div id="description"></div> |
4 <div id="console"></div> | 4 <div id="console"></div> |
5 <script src="../js/resources/js-test-pre.js"></script> | 5 <script src="../js/resources/js-test-pre.js"></script> |
6 <script> | 6 <script> |
7 description('This test checks if setting non-supported type does not throw an ex
ception'); | 7 description('This test checks if setting non-supported type does not throw an ex
ception'); |
8 | 8 |
9 var xhr = new XMLHttpRequest(); | 9 var xhr = new XMLHttpRequest(); |
10 xhr.open('GET', 'resources/plist.app', true); | 10 xhr.open('GET', 'resources/plist.app', true); |
11 | 11 |
12 // Setting valid type does change the responseType value. | 12 // Setting valid type does change the responseType value. |
13 ["", "arraybuffer", "blob", "document", "json", "text"].forEach(function(type) { | 13 ["", "arraybuffer", "blob", "document", "json", "text", "stream"].forEach(functi
on(type) { |
14 xhr.responseType = type; | 14 xhr.responseType = type; |
15 shouldBeEqualToString('xhr.responseType', type); | 15 shouldBeEqualToString('xhr.responseType', type); |
16 }); | 16 }); |
17 | 17 |
18 // Setting invalid type should not throw an exception. | 18 // Setting invalid type should not throw an exception. |
19 shouldNotThrow('xhr.responseType = "dkjdfkjdfkj"'); | 19 shouldNotThrow('xhr.responseType = "dkjdfkjdfkj"'); |
20 | 20 |
21 // Setting invalid type doesn not change the responseType value. | 21 // Setting invalid type doesn not change the responseType value. |
22 shouldBeEqualToString('xhr.responseType = "text"; xhr.responseType = "asdfasdfas
d"; xhr.responseType', 'text'); | 22 shouldBeEqualToString('xhr.responseType = "text"; xhr.responseType = "asdfasdfas
d"; xhr.responseType', 'text'); |
23 | 23 |
24 </script> | 24 </script> |
25 <script src="../js/resources/js-test-post.js"></script> | 25 <script src="../js/resources/js-test-post.js"></script> |
26 </body> | 26 </body> |
OLD | NEW |