summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:22:09 +0000
commit43a97878ce14b72f0981164f87f2e35e14151312 (patch)
tree620249daf56c0258faa40cbdcf9cfba06de2a846 /testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html
parentInitial commit. (diff)
downloadfirefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz
firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html')
-rw-r--r--testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html122
1 files changed, 122 insertions, 0 deletions
diff --git a/testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html b/testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html
new file mode 100644
index 0000000000..ea7973a62e
--- /dev/null
+++ b/testing/web-platform/tests/infrastructure/server/wpt-server-websocket.sub.html
@@ -0,0 +1,122 @@
+<!doctype html>
+<html>
+ <head>
+ <title>WPT Server checker</title>
+ <meta charset="utf-8" />
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ </head>
+</body>
+<body>
+<script>
+function check(protocol, domain, port, done) {
+ var url = protocol + '://' + domain + ':' + port + '/echo';
+ var ws = new WebSocket(url);
+
+ ws.addEventListener('error', function() {
+ done(false);
+ });
+
+ ws.addEventListener('open', function() {
+ done(true);
+ });
+}
+
+async_test(function(t) {
+ check('ws', '{{browser_host}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, no subdomain');
+
+async_test(function(t) {
+ check('ws', '{{domains[www1]}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, www subdomain #1');
+
+async_test(function(t) {
+ check('ws', '{{domains[www1]}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, www subdomain #2');
+
+async_test(function(t) {
+ check('ws', '{{domains[www2]}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, www subdomain #3');
+
+async_test(function(t) {
+ check('ws', '{{domains[élève]}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, punycode subdomain #1');
+
+async_test(function(t) {
+ check('ws', '{{domains[天気の良い日]}}', {{ports[ws][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WS protocol, punycode subdomain #2');
+
+async_test(function(t) {
+ check('wss', '{{browser_host}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, no subdomain');
+
+async_test(function(t) {
+ check('wss', '{{domains[www1]}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, www subdomain #1');
+
+async_test(function(t) {
+ check('wss', '{{domains[www1]}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, www subdomain #2');
+
+async_test(function(t) {
+ check('wss', '{{domains[www2]}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, www subdomain #3');
+
+async_test(function(t) {
+ check('wss', '{{domains[élève]}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, punycode subdomain #1');
+
+async_test(function(t) {
+ check('wss', '{{domains[天気の良い日]}}', {{ports[wss][0]}}, t.step_func(function(result) {
+ assert_true(result);
+
+ t.done();
+ }));
+}, 'WSS protocol, punycode subdomain #2');
+</script>
+</body>
+</html>