summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webrtc/RTCPeerConnection-onicecandidateerror.https.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/webrtc/RTCPeerConnection-onicecandidateerror.https.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/webrtc/RTCPeerConnection-onicecandidateerror.https.html')
-rw-r--r--testing/web-platform/tests/webrtc/RTCPeerConnection-onicecandidateerror.https.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webrtc/RTCPeerConnection-onicecandidateerror.https.html b/testing/web-platform/tests/webrtc/RTCPeerConnection-onicecandidateerror.https.html
new file mode 100644
index 0000000000..096cc9dd1a
--- /dev/null
+++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-onicecandidateerror.https.html
@@ -0,0 +1,38 @@
+<!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>