-
Notifications
You must be signed in to change notification settings - Fork 54
/
002.html
20 lines (20 loc) · 1.29 KB
/
002.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<!doctype html>
<title>WebSockets: new WebSocket(invalid url)</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<script src=../constants.js?pipe=sub></script>
<meta name="variant" content="">
<meta name="variant" content="?wss">
<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>