Bug 1208373 - Test that ended tracks that are cloned are also ended. r?jib draft
authorAndreas Pehrson <pehrsons@gmail.com>
Wed, 04 May 2016 11:28:14 +0200
changeset 363328 e6e399b43857270379e07e2c72c9e7cd6a426fa0
parent 363327 b31fb1aa64748d7296e32d8fd2823eb0c5f7fccc
child 363329 2460adefd6f543a0674f66d79a5eb241ebf15694
push id17172
push userpehrsons@gmail.com
push dateWed, 04 May 2016 14:35:55 +0000
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()));
       }