diff options
Diffstat (limited to 'testing/web-platform/tests/XMLHttpRequest/overridemimetype-done-state.htm')
-rw-r--r-- | testing/web-platform/tests/XMLHttpRequest/overridemimetype-done-state.htm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/XMLHttpRequest/overridemimetype-done-state.htm b/testing/web-platform/tests/XMLHttpRequest/overridemimetype-done-state.htm new file mode 100644 index 000000000..a1711e609 --- /dev/null +++ b/testing/web-platform/tests/XMLHttpRequest/overridemimetype-done-state.htm @@ -0,0 +1,26 @@ +<!doctype html> +<html> + <head> + <title>XMLHttpRequest: overrideMimeType() in DONE state</title> + <meta charset="utf-8"> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="help" href="https://xhr.spec.whatwg.org/#the-overridemimetype()-method" data-tested-assertations="/following::ol/li[1]" /> + </head> + <body> + <div id="log"></div> + <script> + var test = async_test(); + var client = new XMLHttpRequest(); + client.onreadystatechange = test.step_func( function() { + if (client.readyState !== 4) return; + assert_throws("InvalidStateError", function() { client.overrideMimeType('application/xml;charset=Shift-JIS'); }); + assert_equals(client.responseXML, null); + test.done(); + }); + client.open("GET", "resources/status.py?type="+encodeURIComponent('text/plain;charset=iso-8859-1')+'&content=%3Cmsg%3E%83%65%83%58%83%67%3C%2Fmsg%3E'); + client.send(); + </script> + + </body> +</html> |