onaddtrack is not fired when addTrack is used
authorDominique Hazael-Massieux <dom@w3.org>
Thu, 30 May 2013 17:50:19 +0200
changeset 48 9353b5694820
parent 47 05a05fc783b3
child 49 9091b1e5d47e
onaddtrack is not fired when addTrack is used
submitted/W3C/mediastream-addtrack.html
--- a/submitted/W3C/mediastream-addtrack.html	Thu May 30 17:37:51 2013 +0200
+++ b/submitted/W3C/mediastream-addtrack.html	Thu May 30 17:50:19 2013 +0200
@@ -34,17 +34,20 @@
        video.addTrack(audio.getAudioTracks()[0]);
        assert_equals(video.getAudioTracks().length, 1, "video mediastream has now one audio track");
        video.addTrack(audio.getAudioTracks()[0]);
-       assert_equals(video.getAudioTracks().length, 1, "video mediastream still has one audio track");
+       assert_equals(video.getAudioTracks().length, 1, "video mediastream still has one audio track"); // If track is already in stream's track set, then abort these steps.
+
     });
     audio.onaddtrack = t.step_func(function () {
-       assert_true(true, "onaddtrack is triggered on adding a track");
-       t.done();
+       assert_unreached("onaddtrack is not fired when the script directly modified the track of a mediastream");
     });
     t.step(function () {
        assert_equals(audio.getVideoTracks().length, 0, "audio mediastream starts with no video track");
        audio.addTrack(video.getVideoTracks()[0]);
        assert_equals(audio.getVideoTracks().length, 1, "audio mediastream now has one video track");
     });
+    t.step(function () {
+       t.done();
+    });
   }
 });
 </script>