Automatic update from web-platform-tests [WebTransport] Use host substitution instead of hardcoded example.com This gives us a stronger guarantee that we don't accidentally try to connect to example.com, which we really don't want to do. -- wpt-commits: e44d67dce005f1e4ffaadc11765a2336bab3041e wpt-pr: 58491
25 lines
732 B
JavaScript
25 lines
732 B
JavaScript
// META: global=window,worker
|
|
// META: script=/resources/WebIDLParser.js
|
|
// META: script=/resources/idlharness.js
|
|
|
|
'use strict';
|
|
|
|
idl_test(
|
|
['webtransport'],
|
|
['webidl', 'streams'],
|
|
idl_array => {
|
|
idl_array.add_objects({
|
|
WebTransport: ['webTransport'],
|
|
// TODO: The stream APIs below require a working connection to create.
|
|
// BidirectionalStream
|
|
// SendStream
|
|
// ReceiveStream
|
|
});
|
|
self.webTransport = new WebTransport("https://{{domains[nonexistent]}}/");
|
|
// `ready` and `closed` promises will be rejected due to connection error.
|
|
// Catches them to avoid unhandled rejections.
|
|
self.webTransport.ready.catch(() => {});
|
|
self.webTransport.closed.catch(() => {});
|
|
}
|
|
);
|