Bug 1321609 - Don't test media element flow for tracks that were not expected. r=drno a=test-only
authorAndreas Pehrson <pehrsons@gmail.com>
Tue, 22 Nov 2016 16:45:20 +0100
changeset 353226 b662b0fdd2365ff926db5db7b59d8bb56d1ff36f
parent 353225 2f4f0b81600902b19a9c466f3ef6cb3e0ce3209d
child 353227 80e89a0b39c5c21de97eb9f1ad1c60fcdc618992
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno, test-only
bugs1321609
milestone52.0a2
Bug 1321609 - Don't test media element flow for tracks that were not expected. r=drno a=test-only MozReview-Commit-ID: Bapl0P7H9gi
dom/media/tests/mochitest/pc.js
--- a/dom/media/tests/mochitest/pc.js
+++ b/dom/media/tests/mochitest/pc.js
@@ -1442,17 +1442,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.