Bug 1406350 - part3: Use fake constraints to avoid enumeration error in one mochitest. r?pehrsons draft
authorAlex Chronopoulos <achronop@gmail.com>
Wed, 17 Jan 2018 17:01:53 +0200
changeset 721627 584d7c0a0f211df2340a9aa7227c4a3b931f75b8
parent 721551 7926048dd1672f283f65decc8f5efaed94fd7369
child 746392 396d71c279b9e310fc829f71e82038d4252eee6e
push id95900
push userachronop@gmail.com
push dateWed, 17 Jan 2018 16:21:36 +0000
reviewerspehrsons
bugs1406350
milestone59.0a1
Bug 1406350 - part3: Use fake constraints to avoid enumeration error in one mochitest. r?pehrsons MozReview-Commit-ID: 4nqamvBsNbo
dom/media/tests/mochitest/test_peerConnection_replaceTrack.html
--- a/dom/media/tests/mochitest/test_peerConnection_replaceTrack.html
+++ b/dom/media/tests/mochitest/test_peerConnection_replaceTrack.html
@@ -34,17 +34,18 @@
     ok(sender, "We have a sender for video");
     ok(allLocalStreamsHaveSender(pc),
        "Shouldn't have any local streams without a corresponding sender");
     ok(allRemoteStreamsHaveReceiver(pc),
        "Shouldn't have any remote streams without a corresponding receiver");
 
     var newTrack;
     var audiotrack;
-    return getUserMedia({video:true, audio:true})
+    // Remove fake constraints with Bug 1431056
+    return getUserMedia({fake:true, video:true, audio:true})
       .then(newStream => {
         window.grip = newStream;
         newTrack = newStream.getVideoTracks()[0];
         audiotrack = newStream.getAudioTracks()[0];
         isnot(newTrack, sender.track, "replacing with a different track");
         ok(!pc.getLocalStreams().some(s => s == newStream),
            "from a different stream");
         // Use wrapper function, since it updates expected tracks
@@ -64,17 +65,18 @@
                 e => is(e.name, "TypeError",
                         "replacing with different kind should fail"));
       });
   }
 
   runNetworkTest(function () {
     test = new PeerConnectionTest();
     test.audioCtx = new AudioContext();
-    test.setMediaConstraints([{video: true, audio: true}], [{video: true}]);
+    // Remove fake constraints with Bug 1431056
+    test.setMediaConstraints([{fake: true, video: true, audio: true}], [{fake: true, video: true}]);
     test.chain.removeAfter("PC_REMOTE_WAIT_FOR_MEDIA_FLOW");
 
     // Test replaceTrack on pcRemote separately since it's video only.
     test.chain.append([
       function PC_REMOTE_VIDEOONLY_REPLACE_VIDEOTRACK(test) {
         return replacetest(test.pcRemote);
       },
       function PC_LOCAL_NEW_VIDEOTRACK_WAIT_FOR_MEDIA_FLOW(test) {