-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Update RTCPeerConnection-helper.js #14417
Update RTCPeerConnection-helper.js #14417
Conversation
@lgrahl, PTAL |
Looks good to me. One thing: Considering the amount of effort put into this work, I would prefer the commit in the three PRs being authored by myself ( |
c115aba
to
d81df6d
Compare
d81df6d
to
c7baefa
Compare
b1e1c8d
to
b8e143a
Compare
@jan-ivar will suggest a better way to handle early candidates at callee than the one proposed here. |
|
This PR no longer changes any ICE candidate processing. |
This PR is blocked on the required "Travis CI - Pull Request" check after #14499. In order to trigger it, I will close and reopen this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code is not broken, but note my reservations.
remotePc.setLocalDescription(answer), | ||
localPc.setRemoteDescription(answer)])) | ||
// between two local peer connections | ||
async function doSignalingHandshake(localPc, remotePc, options={}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but I dislike helpers options when they turn into replacement APIs.
doSignalingHandshake(pc1, pc2, {modfiyOffer: offer => myRegExp(offer)});
The above produces a false positive, due to my typo (did you catch it?), a problem the spec API does not have:
await pc1.setLocalDescription(myRegExp(await pc1.createOffer()));
await pc2.setRemoteDescription(pc1.localDescription);
await pc2.setLocalDescription(await pc2.createAnswer());
await pc1.setRemoteDescription(pc2.localDescription);
The above is appropriate for the (few) who need to mangle SDP IMHO. If not, I'd prefer the more typo-safe:
doSignalingHandshakeModifyOfferAnswer(pc1, pc2, offer => myRegExp(offer), answer => answer);
As to plain doSignalingHandshake, once crbug 740501 is fixed, could we use the spec-provided API instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doSignalingHandshakeModifyOfferAnswer seems better to me as well.
Let's merge this PR for now, that will allow making progress on merging the data channel tests.
We can improve on it later as a refactoring PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #14633 to track the refactoring PR.
Take RTCPeerConnection-helper.js changes from #13499
This contains changes that should not affect existing tests but might be required to land new tests or modified tests from #13499.
Compared to #13499, no change have been made yet to createDataChannelPair since this seems to change behavior of existing tests.
A separate PR could be envisioned to land these changes separately.