Bug 1321609 - Don't test media element flow for tracks that were not expected. r=drno
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 22 Nov 2016 16:45:20 +0100
changeset 325109 82cd79862bab05ae8afb3dec503c4d99c7dd8853
parent 325108 eea552a9e16285b98c5971e7a8a7c141a55477d4
child 325110 617cd94bd7c5ff1dbcd3083bbe1c843bfb2fdb49
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersdrno
bugs1321609
milestone53.0a1
Bug 1321609 - Don't test media element flow for tracks that were not expected. r=drno MozReview-Commit-ID: Bapl0P7H9gi
dom/media/tests/mochitest/pc.js
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -1446,17 +1446,20 @@ PeerConnectionWrapper.prototype = {
    * all sending and receiving track involved in this test.
    *
    * @returns {Promise}
    *        A promise that resolves when media flows for all elements and tracks
    */
   waitForMediaFlow : function() {
     return Promise.all([].concat(
       this.localMediaElements.map(element => this.waitForMediaElementFlow(element)),
-      this.remoteMediaElements.map(element => this.waitForMediaElementFlow(element)),
+      Object.keys(this.expectedRemoteTrackInfoById)
+          .map(id => this.remoteMediaElements
+              .find(e => e.srcObject.getTracks().some(t => t.id == id)))
+          .map(e => this.waitForMediaElementFlow(e)),
       this._pc.getSenders().map(sender => this.waitForRtpFlow(sender.track)),
       this._pc.getReceivers().map(receiver => this.waitForRtpFlow(receiver.track))));
   },
 
   /**
    * Check that correct audio (typically a flat tone) is flowing to this
    * PeerConnection. Uses WebAudio AnalyserNodes to compare input and output
    * audio data in the frequency domain.