Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic test for generated SDP #13887

Merged
merged 2 commits into from
Nov 4, 2018

Conversation

alvestrand
Copy link
Contributor

This adds a protocol test that SDP is generated by createOffer
conforming to JSEP requirements.

This adds a protocol test that SDP is generated by createOffer
conforming to JSEP requirements.
// "such as" IN IP4 127.0.0.1. We do strict matching here in order
// 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]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on Firefox as it has the username field value "mozilla...THIS_IS_SDPARTA". JSEP says "The value of the <username> field SHOULD be "-"". Since it is optional it should not result in a test failure.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nils-ohlmeier says that Firefox expects to change this.
SHOULD is a problem for tests; if we don't test them, will they ever be tested?

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);
// Note: using - in s=- is a SHOULD in JSEP, not a MUST.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should being not complying to "SHOULD" requirements in JSEP result in test failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that we should (SHOULD) do that....

@wpt-pr-bot
Copy link
Collaborator

There are no reviewers for this pull request besides its author. Please reach out on W3C's irc server (irc.w3.org, port 6665) on channel #testing (web client) to get help with this. Thank you!

@alvestrand alvestrand merged commit da8939d into web-platform-tests:master Nov 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants