https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 322a0d9b5c7d79d4da4fc7ebd0c6bc60a7effe74 authored by Hallvord Reiar M. Steen on 21 June 2016, 13:44:08 UTC
Misc improvements to progress event tests
Tip revision: 322a0d9
overridemimetype-invalid-mime-type.htm
<!doctype html>
<html>
  <head>
    <title>XMLHttpRequest: overrideMimeType() in unsent state, invalid MIME types</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[2]" />
  </head>
  <body>
    <div id="log"></div>
    <script>
      test(function() {
        var client = new XMLHttpRequest();
        assert_throws("SyntaxError", function() { client.overrideMimeType('text\\plain;charset=Shift-JIS'); });
        assert_throws("SyntaxError", function() { client.overrideMimeType('text plain;charset=Shift-JIS'); });
        assert_throws("SyntaxError", function() { client.overrideMimeType('text\nplain;charset=Shift-JIS'); });
        assert_throws("SyntaxError", function() { client.overrideMimeType('cahrset=Shift-JIS'); });
        assert_throws("SyntaxError", function() { client.overrideMimeType(null); });
        assert_throws("SyntaxError", function() { client.overrideMimeType(50212); });
        assert_throws("SyntaxError", function() { client.overrideMimeType( (new Array(1000)).join('a/b/c/') ); });
      });
    </script>
  </body>
</html>
back to top