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 907B

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