From 34f7fa7c9a4290d7cf2523fbf221a532f969408e Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Sat, 3 Nov 2018 08:13:44 +0100 Subject: [PATCH 1/2] Basic test for generated SDP This adds a protocol test that SDP is generated by createOffer conforming to JSEP requirements. --- webrtc/protocol/jsep-initial-offer.https.html | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 webrtc/protocol/jsep-initial-offer.https.html diff --git a/webrtc/protocol/jsep-initial-offer.https.html b/webrtc/protocol/jsep-initial-offer.https.html new file mode 100644 index 00000000000000..9f47c5a88f7ef3 --- /dev/null +++ b/webrtc/protocol/jsep-initial-offer.https.html @@ -0,0 +1,30 @@ + + +RTCPeerConnection.prototype.createOffer + + + + From 79745f4dea4a98e00faa378a5e55d2f989243fc6 Mon Sep 17 00:00:00 2001 From: Harald Alvestrand Date: Sat, 3 Nov 2018 09:53:48 +0100 Subject: [PATCH 2/2] Update sess-id test --- webrtc/protocol/jsep-initial-offer.https.html | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webrtc/protocol/jsep-initial-offer.https.html b/webrtc/protocol/jsep-initial-offer.https.html index 9f47c5a88f7ef3..d65ee5e9621af5 100644 --- a/webrtc/protocol/jsep-initial-offer.https.html +++ b/webrtc/protocol/jsep-initial-offer.https.html @@ -21,7 +21,12 @@ // to detect if anyone ever uses something different. assert_regexp_match(offer_lines[1], /^o=- \d+ \d+ IN IP4 127.0.0.1$/); const fields = RegExp(/^o=- (\d+) (\d+)/).exec(offer_lines[1]); - assert_less_than(Number(fields[1]), 2**62); + // Per RFC 3264, the sess-id should be representable in an uint64 + // Note: JSEP -24 has this wrong - see bug: + // https://github.com/rtcweb-wg/jsep/issues/855 + assert_less_than(Number(fields[1]), 2**64); + // Per RFC 3264, the version should be less than 2^62 to avoid overflow + assert_less_than(Number(fields[2]), 2**62); // Note: using - in s=- is a SHOULD in JSEP, not a MUST. assert_equals(offer_lines[2], "s=-"); // After this, the order is not dictated by JSEP.