summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/websockets/Create-invalid-urls.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/websockets/Create-invalid-urls.any.js')
-rw-r--r--testing/web-platform/tests/websockets/Create-invalid-urls.any.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/websockets/Create-invalid-urls.any.js b/testing/web-platform/tests/websockets/Create-invalid-urls.any.js
new file mode 100644
index 0000000000..73c9fadab9
--- /dev/null
+++ b/testing/web-platform/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`);
+});