mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 12:51:09 +02:00
Automatic update from web-platform-tests Replace hostCandidate with address and port in RTCPeerConnectionIceErrorEvent Spec: https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnectioniceerrorevent Intent: https://groups.google.com/a/chromium.org/d/msg/blink-dev/fs-Y4awdYj0/1UOKRxzmBQAJ Bug: chromium:1013564 Change-Id: I32c7d731a08dc75adcfe640357e8636f7c4325be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1944346 Commit-Queue: Eldar Rello <elrello@microsoft.com> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Reviewed-by: Henrik Boström <hbos@chromium.org> Cr-Commit-Position: refs/heads/master@{#732828} -- wpt-commits: 52acc76bca9fdc61e881c672d4b8fd1de07eeaf7 wpt-pr: 20605
38 lines
1.5 KiB
HTML
38 lines
1.5 KiB
HTML
<!doctype html>
|
|
<meta charset=utf-8>
|
|
<title>RTCPeerConnection.prototype.onicecandidateerror</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="RTCPeerConnection-helper.js"></script>
|
|
<script>
|
|
|
|
promise_test(async t => {
|
|
const config = {
|
|
iceServers: [{urls: "turn:123", username: "123", credential: "123"}]
|
|
};
|
|
const pc = new RTCPeerConnection(config);
|
|
t.add_cleanup(() => pc.close());
|
|
const onErrorPromise = addEventListenerPromise(t, pc, 'icecandidateerror', event => {
|
|
assert_true(event instanceof RTCPeerConnectionIceErrorEvent,
|
|
'Expect event to be instance of RTCPeerConnectionIceErrorEvent');
|
|
// Do not hardcode any specific errors here. Instead only verify
|
|
// that all the fields contain something expected.
|
|
// Testing of event.errorText can be added later once it's content is
|
|
// specified in spec with more detail.
|
|
assert_true(event.errorCode >= 300 && event.errorCode <= 799, "errorCode");
|
|
if (event.port == 0) {
|
|
assert_equals(event.address, null);
|
|
} else {
|
|
assert_true(event.address.includes(".") || event.address.includes(":"));
|
|
}
|
|
assert_true(event.url.includes("123"), "url");
|
|
});
|
|
const stream = await getNoiseStream({audio:true});
|
|
t.add_cleanup(() => stream.getTracks().forEach(track => track.stop()));
|
|
pc.addTrack(stream.getAudioTracks()[0], stream);
|
|
|
|
await pc.setLocalDescription(await pc.createOffer());
|
|
await onErrorPromise;
|
|
}, 'Surfacing onicecandidateerror');
|
|
|
|
</script>
|