diff options
Diffstat (limited to 'test/wpt/tests/websockets/Create-invalid-urls.any.js')
-rw-r--r-- | test/wpt/tests/websockets/Create-invalid-urls.any.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/wpt/tests/websockets/Create-invalid-urls.any.js b/test/wpt/tests/websockets/Create-invalid-urls.any.js new file mode 100644 index 0000000..73c9fad --- /dev/null +++ b/test/wpt/tests/websockets/Create-invalid-urls.any.js @@ -0,0 +1,14 @@ +[ + "ws://foo bar.com/", + "wss://foo bar.com/", + "ftp://"+location.host+"/", + "mailto:example@example.org", + "about:blank", + location.origin + "/#", + location.origin + "/#test", + "#test" +].forEach(input => { + test(() => { + assert_throws_dom("SyntaxError", () => new WebSocket(input)); + }, `new WebSocket("${input}") should throw a "SyntaxError" DOMException`); +}); |