Skip to content

Commit

Permalink
Implement RTCPeerConnection.onicecandidateerror and add web-platform-…
Browse files Browse the repository at this point in the history
  • Loading branch information
kulternah authored and chromium-wpt-export-bot committed Jul 4, 2019
1 parent 8b34e2a commit d1b9d8e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions webrtc/RTCPeerConnection-onicecandidateerror.html
@@ -0,0 +1,30 @@
<!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', e => {
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
assert_true(event.errorCode >= 300 && event.errorCode <= 799, "errorCode");
assert_true(event.errorText.includes("."), "errorText");
assert_true(event.hostCandidate.includes(":"), "hostCandidate");
assert_true(event.url.includes("123"), "url");
});
const offerOptions = {offerToReceiveAudio: 1};
await pc.setLocalDescription(await pc.createOffer(offerOptions));
await onErrorPromise;
}, 'Surfacing onicecandidateerror');

</script>

0 comments on commit d1b9d8e

Please sign in to comment.