blob: 8c80c23735f1cc32e0ed9e7ff30504514c837245 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
<!doctype html>
<title>WebSockets: new WebSocket(invalid url)</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../constants.sub.js></script>
<meta name="variant" content="">
<meta name="variant" content="?wss">
<meta name="variant" content="?wpt_flags=h2">
<div id=log></div>
<script>
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("/test")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("ws://foo bar.com/")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("wss://foo bar.com/")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("http://"+location.host+"/")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("mailto:example@example.org")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("about:blank")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket(SCHEME_DOMAIN_PORT+"/#")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket(SCHEME_DOMAIN_PORT+"/#test")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("?test")})});
test(function() {assert_throws_dom("SyntaxError", function(){new WebSocket("#test")})});
</script>
|