Commit bed47516 authored by Harald Alvestrand's avatar Harald Alvestrand Committed by Commit Bot

Add test for setCodecPreferences with shortened codec list

Bug: none
Change-Id: Ibf43c6968f8fc3b38668fb636eeeb5094916453d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2039671Reviewed-by: default avatarMarina Ciocea <marinaciocea@chromium.org>
Commit-Queue: Harald Alvestrand <hta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738896}
parent 4fa51a57
...@@ -77,6 +77,23 @@ ...@@ -77,6 +77,23 @@
}, `setCodecPreferences() with reordered codecs should succeed`); }, `setCodecPreferences() with reordered codecs should succeed`);
test(() => {
const pc = new RTCPeerConnection();
const transceiver = pc.addTransceiver('video');
const capabilities = RTCRtpSender.getCapabilities('video');
const { codecs } = capabilities;
// This test verifies that the mandatory VP8 codec is present
// and can be set.
let tried = false;
codecs.forEach(codec => {
if (codec.mimeType.toLowerCase() === 'video/vp8') {
transceiver.setCodecPreferences([codecs[0]]);
tried = true;
}
});
assert_true(tried, 'VP8 video codec was found and tried');
}, `setCodecPreferences() with only one video codec should succeed`);
test(() => { test(() => {
const pc = new RTCPeerConnection(); const pc = new RTCPeerConnection();
const transceiver = pc.addTransceiver('audio'); const transceiver = pc.addTransceiver('audio');
......
...@@ -4,6 +4,7 @@ FAIL setCodecPreferences() on video transceiver with codecs returned from RTCRtp ...@@ -4,6 +4,7 @@ FAIL setCodecPreferences() on video transceiver with codecs returned from RTCRtp
FAIL setCodecPreferences() with both sender receiver codecs combined should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences() with both sender receiver codecs combined should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences([]) should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences([]) should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences() with reordered codecs should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences() with reordered codecs should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences() with only one video codec should succeed Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences() on audio transceiver with codecs returned from getCapabilities('video') should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences() on audio transceiver with codecs returned from getCapabilities('video') should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences() with user defined codec with invalid mimeType should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences() with user defined codec with invalid mimeType should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
FAIL setCodecPreferences() with user defined codec should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'. FAIL setCodecPreferences() with user defined codec should throw InvalidModificationError Failed to execute 'addTransceiver' on 'RTCPeerConnection': This operation is only supported in 'unified-plan'.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment