You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SDPUtil.spec.js 862B

12345678910111213141516171819202122
  1. import * as SDPUtil from './SDPUtil';
  2. import * as SampleSdpStrings from './SampleSdpStrings.js';
  3. describe('SDPUtil', function() {
  4. it('should parse an ice ufrag correctly', function() {
  5. const line = 'a=ice-ufrag:3jlcc1b3j1rqt6';
  6. const parsed = SDPUtil.parse_iceufrag(line);
  7. expect(parsed).toEqual('3jlcc1b3j1rqt6');
  8. });
  9. describe('preferVideoCodec', function() {
  10. it('should move a preferred codec to the front', function() {
  11. const sdp = SampleSdpStrings.multiCodecVideoSdp;
  12. const videoMLine = sdp.media.find(m => m.type === 'video');
  13. SDPUtil.preferVideoCodec(videoMLine, 'H264');
  14. const newPayloadTypesOrder
  15. = videoMLine.payloads.split(' ').map(ptStr => parseInt(ptStr));
  16. expect(newPayloadTypesOrder[0]).toEqual(126);
  17. });
  18. });
  19. });