For test verification we should have a simple JS SDP parser

NEW
Unassigned

Status

()

Core
WebRTC
P5
normal
Rank:
45
4 years ago
7 months ago

People

(Reporter: drno, Unassigned)

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [webrtc-mochitest])

(Reporter)

Description

4 years ago
To be able to do simple sanity checks (better then just simple string search) we should have a simple SDP parser is JavaScript which allows to inspect the SDP.
(Reporter)

Comment 1

4 years ago
This is a candidate to look at: https://github.com/otalk/sdp-jingle-json
Are abstraction layers of this kind a good idea in a testing framework? Do we have other code that needs this to be in jingle? If not, then translating A to B to me means more code that can go wrong, plus having to learn both A and B ("Law of leaky abstractions").

To test that the SDP is accurate, I think we should test that the SDP is accurate. Why not regular expressions?
(Reporter)

Comment 3

4 years ago
BTW this is not meant as choosing sdp-jingle-json. Just one possible alternative.

I'm not against regex's, but http://stackoverflow.com/questions/764247/why-are-regular-expressions-so-controversial

To verify things like: does the first video m line have recvonly, and the second sendrecv is certainly doable in regex, but will be really hard to read/maintain. Or are you thinking of writing a whole bunch of functions to with regex in them to extract and verify given criteria?
(In reply to Nils Ohlmeier [:drno] from comment #3)
> To verify things like: does the first video m line have recvonly, and the
> second sendrecv is certainly doable in regex, but will be really hard to
> read/maintain.

Here's a fiddle for that fwiw: http://jsfiddle.net/jib1/xv3eL7oa

Are we validating the SDP as a whole anywhere else? If not, would this jingle library validate the SDP for us in the process of using it? If so then I can see some value in it.
(Reporter)

Updated

3 years ago
Whiteboard: [webrtc-mochitest]
backlog: --- → webRTC+
Rank: 45
Priority: -- → P4
Mass change P4->P5 to align with new Mozilla triage process.
Priority: P4 → P5
You need to log in before you can comment on or make changes to this bug.