https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 6b0baa94df5def53b9a3c3f1a926b68999ac7e20 authored by Simon Pieters on 31 March 2016, 16:08:10 UTC
Add <meta name=variant>s to websocket tests for wss:
Tip revision: 6b0baa9
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