Bug 1208373 - Test that ended tracks that are cloned are also ended. r=jib
☠☠ backed out by 54e742653c70 ☠ ☠
authorAndreas Pehrson <pehrsons@gmail.com>
Wed, 04 May 2016 11:28:14 +0200
changeset 297363 133c1cb39c00fefe3274fa15526c4eea07f1f694
parent 297362 e24de2c6fdb6a3158f69d9a47d3a93bf3b8bb3a5
child 297364 1709366abefd64839fa333f9a0c03daedd3ceecc
push id19218
push userkwierso@gmail.com
push dateFri, 13 May 2016 23:46:15 +0000
treeherderfx-team@93d60e9db618 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjib
bugs1208373
milestone49.0a1
Bug 1208373 - Test that ended tracks that are cloned are also ended. r=jib MozReview-Commit-ID: 4YU31TK0Mdf
dom/media/tests/mochitest/test_getUserMedia_mediaStreamTrackClone.html
--- a/dom/media/tests/mochitest/test_getUserMedia_mediaStreamTrackClone.html
+++ b/dom/media/tests/mochitest/test_getUserMedia_mediaStreamTrackClone.html
@@ -47,17 +47,20 @@
       var cloneStream = new MediaStream();
       cloneStream.addTrack(inceptionClone);
 
       // cloneStream is now essentially the same as stream.clone();
       checkMediaStreamCloneAgainstOriginal(cloneStream, stream);
 
       var test = createMediaElement('video', 'testClonePlayback');
       var playback = new MediaStreamPlayback(test, cloneStream);
-      return playback.playMediaWithMediaStreamTracksStop(false);
+      return playback.playMediaWithMediaStreamTracksStop(false)
+        .then(() => info("Testing that clones of ended tracks are ended"))
+        .then(() => cloneStream.clone().getTracks().forEach(t =>
+          is(t.readyState, "ended", "Track " + t.id + " should be ended")));
     })
     .then(() => getUserMedia({audio: true, video: true})).then(stream => {
       info("Test adding many track clones to the original stream");
 
       const LOOPS = 3;
       for (var i = 0; i < LOOPS; i++) {
         stream.getTracks().forEach(t => stream.addTrack(t.clone()));
       }