summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/infrastructure/server/http2-websocket.sub.h2.any.js
blob: 617f9ca4e0ad1effa51db62cb5149375cce208c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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('wss', '{{browser_host}}', {{ports[h2][0]}}, t.step_func(function(result) {
    assert_true(result);

    t.done();
  }));
}, 'WSS over h2');