[web-platform-tests] Pull Request: setRemoteDescripton: Unify SRD and events, fire in the correct order.

wpt-pr-bot has just labeled a pull request from chromium-wpt-export-bot for https://github.com/w3c/web-platform-tests as "wg-webrtc":

== setRemoteDescripton: Unify SRD and events, fire in the correct order. ==
This includes RTCPeerConnection.onaddtrack, MediaStream.onaddtrack/
onremovetrack and MediaStreamTrack.onmute.

Instead of updating which tracks belong to which streams in an observer
that listens to OnChanged in webrtc and PostTasks to the main thread
once per stream, all stream states are updated in the SRD callback along
with all the other state changes. Spec:
https://w3c.github.io/webrtc-pc/#processing-remote-mediastreamtracks

With this CL, https://crbug.com/777999 and https://crbug.com/webrtc/8473
are fixed.

All events are currently scheduled to fire instead of firing
synchronously (https://crbug.com/788558), so to make the promise resolve
after all the events have fired we PostTask to resolve the promise.

Bug: chromium:777999, webrtc:8473, chromium:788558
Change-Id: I21cce27b4e541ae6a53d6a9f91c73d181f3dd88e
Reviewed-on: https://chromium-review.googlesource.com/789843
WPT-Export-Revision: eb78e5aff22fd723d4d03e7391213b6903649f5c

See https://github.com/w3c/web-platform-tests/pull/8454

Received on Monday, 27 November 2017 16:53:52 UTC