| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="/js-test-resources/js-test-pre.js"></script> | 4 <script src="/js-test-resources/js-test.js"></script> |
| 5 </head> | 5 </head> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 description('This tests that XMLHttpRequest overrideMimeType() properly
updates the Content-Type header for the response.'); | 8 description('This tests that XMLHttpRequest overrideMimeType() properly
updates the Content-Type header for the response.'); |
| 9 window.jsTestIsAsync = true; | 9 window.jsTestIsAsync = true; |
| 10 | 10 |
| 11 var xhr = new XMLHttpRequest(); | 11 var xhr = new XMLHttpRequest(); |
| 12 var url = 'resources/reply.xml'; | 12 var url = 'resources/reply.xml'; |
| 13 | 13 |
| 14 xhr.onreadystatechange = function () { | 14 xhr.onreadystatechange = function () { |
| 15 if (xhr.readyState == xhr.LOADING) { | 15 if (xhr.readyState == xhr.LOADING) { |
| 16 shouldBe('xhr.getResponseHeader("Content-Type")', '"text/xml;cha
rset=GBK"'); | 16 shouldBe('xhr.getResponseHeader("Content-Type")', '"text/xml;cha
rset=GBK"'); |
| 17 finishJSTest(); | 17 finishJSTest(); |
| 18 } | 18 } |
| 19 } | 19 } |
| 20 | 20 |
| 21 xhr.onerror = function() { | 21 xhr.onerror = function() { |
| 22 testFailed('The XHR request to an existing resource failed: "' + url
+ '"'); | 22 testFailed('The XHR request to an existing resource failed: "' + url
+ '"'); |
| 23 finishJSTest(); | 23 finishJSTest(); |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 xhr.open('GET', url); | 26 xhr.open('GET', url); |
| 27 xhr.overrideMimeType('text/xml;charset=GBK'); | 27 xhr.overrideMimeType('text/xml;charset=GBK'); |
| 28 xhr.send(); | 28 xhr.send(); |
| 29 </script> | 29 </script> |
| 30 </body> | 30 </body> |
| 31 </html> | 31 </html> |
| OLD | NEW |