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

webrtc: make transceiver tests work in Firefox #12141

Merged
merged 1 commit into from
Jul 30, 2018

Conversation

fippo
Copy link
Contributor

@fippo fippo commented Jul 23, 2018

makes most new transceiver tests pass by avoiding addTrack(track) which does not work in Firefox yet.

@henbos PTAL

@alvestrand @foolip it would be great if you folks ran the tests in Firefox at least once before pushing them and/or asked whether that was done during review. Most things that did not work in Firefox were easy to avoid. The setRemoteDescription(offer): ontrack's track.id is the same as track.id fails in Firefox but that is ok, the spec does NOT require this.

@foolip
Copy link
Member

foolip commented Jul 23, 2018

@alvestrand @foolip it would be great if you folks ran the tests in Firefox at least once before pushing them and/or asked whether that was done during review. Most things that did not work in Firefox were easy to avoid. The setRemoteDescription(offer): ontrack's track.id is the same as track.id fails in Firefox but that is ok, the spec does NOT require this.

Our plan for this is to first surface test regressions in PRs, and if that works propagate that up into the Chromium CL before it is merged. Manually testing changes in the Chromium tree in other browsers (on the same OS) is possible, but time-consuming, so I don't think that'll fix the problem at scale.

const transceiver = pc.addTransceiver(track, {
sendEncodings: [{active:false}]
sendEncodings: [{active:false}]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Shouldn't this be indented?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, fixed + squashed

@@ -64,8 +64,8 @@

promise_test(async t => {
const pc = createPeerConnectionWithCleanup(t);
const track = await createTrackWithCleanup(t);
const sender = pc.addTrack(track);
const [track, stream] = await createTrackWithCleanup(t);
Copy link
Contributor

Choose a reason for hiding this comment

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

If this returns both a track and a stream now, a name like createTrackAndStreamWithCleanup() makes more sense.

However, in the spirit of moving away from streams-with-tracks, you don't really need a stream where the track belongs to it. The relationship, as far as webrtc is concerned, is entirely described in terms of the senders and receivers.

What about not returning the stream, and instead doing this...?

pc.addTrack(track, new MediaStream());

That way we don't have to return an array of two different return values, and the helper method can do just one thing.

Assuming Firefox does not barf at that too. But this is optional, the "add[Track/Transceiver]([0/1/2] stream[/s])" tests already test the "new MediaStream()" semantics.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

last i checked the consensus was to avoid helper functions like this entirely. I won't clean up after you all the way :-p
Doing pc.addTrack(track, new MediaStream()) just to avoid limitations of a helper function seems even worse.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

renamed to createTrackAndStreamWithCleanup and squashed

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not to avoid a limitation of a helper function, it's to make the helper function do one thing: create a track that is cleaned up. The stream being created is an implementation detail we don't have to expose, and makes less sense when you want to have 0 or 2 streams for a track. It would be confusion to create multiple tracks just to get multiple streams, this is why we already do "new MediaStream()" in the "add[Track/Transceiver]([0/1/2] stream[/s])" tests, so I thought we could be consistent and do that everywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

using new MediaStream() means adding a track that is not part of the stream. While that is probably useful to test it is somewhat artificial. ISTR that Firefox did not like this at some point but it seems to work in FF52 (ESR) even.

WRT to helpers it seems that there is also getNoiseStream which returns a stream. I'd prefer nott o increase the number of different semantics we use even more

Copy link
Contributor

Choose a reason for hiding this comment

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

Whether the track is part of the stream or not is per-spec completely irrelevant. There is absolutely nothing that says we should test this, other than "this is how the legacy stuff worked". It makes sense to have tests to make sure that the APIs work regardless of if the stream is empty, has the track, has another track, etc, just to make sure that common use cases are supported. But they should not be the basis for designing tests testing APIs that have nothing to say about what the contents of the stream is.

Therefor we should design our tests not with that in mind.

Copy link
Contributor

Choose a reason for hiding this comment

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

So we should decide this based on: What makes more sense? A helper that gives us a track, or a helper that gives us both?

I argue the first makes slightly more sense, but I also realize I am bikeshedding. It's up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

E_TOO_MANY_HELPERS. I still prefer

const stream = await navigator.mediaDevices.getUserMedia({audio: true})
const [ŧrack] = stream.getTracks();

Lines of code are cheap.

Therefor we should design our tests not with that in mind.

We're much better of when taking into account the imperfection of implementations. In this case Firefox not liking addTrack without a stream. This shouldn't stop them from implementing that ofc but the compat hit should be in the addTrack() tests.

@fippo
Copy link
Contributor Author

fippo commented Jul 25, 2018

@foolip my point is that the current approach, saving dev-tme for chrome and pushing it to mozilla is rather impolite.

makes most new transceiver tests pass by avoiding addTrack(track)
which does not work in Firefox yet.
@agouaillard-cosmo
Copy link

Sorry I'm late to the review. I never get notifications in the first place because of the rather impolite behaviour of some submitters that intentionally block official reviewers.

Copy link
Contributor

@henbos henbos left a comment

Choose a reason for hiding this comment

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

LGTM with optional comment of making createTrackWithCleanup only return a track, and using new MediaStream() when you want a stream

@alvestrand alvestrand merged commit 00d1189 into web-platform-tests:master Jul 30, 2018
@fippo fippo deleted the remember-firefox branch July 30, 2018 14:34
chromium-wpt-export-bot pushed a commit that referenced this pull request Jul 30, 2018
This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
aarongable pushed a commit to chromium/chromium that referenced this pull request Jul 31, 2018
This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579341}
chromium-wpt-export-bot pushed a commit that referenced this pull request Jul 31, 2018
This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579341}
pull bot pushed a commit to hoojaoh/web-platform-tests that referenced this pull request Jul 31, 2018
This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579341}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Aug 3, 2018
….html bug., a=testonly

Automatic update from web-platform-testsFix RTCPeerConnection-transceivers.https.html bug.

This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579341}

--

wpt-commits: 6468c69f9f9e5925f6af370ad127a72c3adc14ed
wpt-pr: 12237
jankeromnes pushed a commit to jankeromnes/gecko that referenced this pull request Aug 3, 2018
….html bug., a=testonly

Automatic update from web-platform-testsFix RTCPeerConnection-transceivers.https.html bug.

This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <[email protected]>
Commit-Queue: Henrik Boström <[email protected]>
Cr-Commit-Position: refs/heads/master@{#579341}

--

wpt-commits: 6468c69f9f9e5925f6af370ad127a72c3adc14ed
wpt-pr: 12237
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 3, 2019
….html bug., a=testonly

Automatic update from web-platform-testsFix RTCPeerConnection-transceivers.https.html bug.

This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <htachromium.org>
Commit-Queue: Henrik Boström <hboschromium.org>
Cr-Commit-Position: refs/heads/master{#579341}

--

wpt-commits: 6468c69f9f9e5925f6af370ad127a72c3adc14ed
wpt-pr: 12237

UltraBlame original commit: e5221e193074c83a7ee7028a0ca894d8268490f2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 3, 2019
….html bug., a=testonly

Automatic update from web-platform-testsFix RTCPeerConnection-transceivers.https.html bug.

This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <htachromium.org>
Commit-Queue: Henrik Boström <hboschromium.org>
Cr-Commit-Position: refs/heads/master{#579341}

--

wpt-commits: 6468c69f9f9e5925f6af370ad127a72c3adc14ed
wpt-pr: 12237

UltraBlame original commit: e5221e193074c83a7ee7028a0ca894d8268490f2
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 3, 2019
….html bug., a=testonly

Automatic update from web-platform-testsFix RTCPeerConnection-transceivers.https.html bug.

This PR accidentally made the "addTrack(0 streams)" test call addTrack()
with a stream, which broke the tests:
web-platform-tests/wpt#12141

Test restored and all "addTrack/addTransceiver(X streams)" are made to
consistently use "new MediaStream()" the same way.

Bug: 869036
Change-Id: Ieaf0c73a1996aeb2e87e18f2f9065fa1e6fee1e7
Reviewed-on: https://chromium-review.googlesource.com/1155125
Reviewed-by: Harald Alvestrand <htachromium.org>
Commit-Queue: Henrik Boström <hboschromium.org>
Cr-Commit-Position: refs/heads/master{#579341}

--

wpt-commits: 6468c69f9f9e5925f6af370ad127a72c3adc14ed
wpt-pr: 12237

UltraBlame original commit: e5221e193074c83a7ee7028a0ca894d8268490f2
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.

6 participants