adapted to new spec
authorDominique Hazael-Massieux <dom@w3.org>
Thu, 30 May 2013 18:53:28 +0200
changeset 49 9091b1e5d47e
parent 48 9353b5694820
child 50 0566e74f19f9
adapted to new spec
submitted/W3C/mediastreamtracklist-finished.html
--- a/submitted/W3C/mediastreamtracklist-finished.html	Thu May 30 17:50:19 2013 +0200
+++ b/submitted/W3C/mediastreamtracklist-finished.html	Thu May 30 18:53:28 2013 +0200
@@ -17,25 +17,26 @@
 <script src=featuredetection.js></script>
 <script src=prefix.js></script>
 <script>
-var t = async_test("Tests that an addition to a finished MediaStream raises an exception");
+var t = async_test("Tests that an addition to a finished MediaStream raises an exception", {timeout:20000});
 t.step(function () {
   var audio, video;
 
-  navigator.getUserMedia({audio:true}, gotAudio);
+  navigator.getUserMedia({audio:true}, gotAudio, function() {});
   function gotAudio(stream) {
     audio = stream;
-    navigator.getUserMedia({video:true}, gotVideo);
+    navigator.getUserMedia({video:true}, gotVideo, function() {});
   }
 
   function gotVideo(stream) {
     video = stream;
     t.step(function () {
-       audio.stop();
+       audio.getAudioTracks()[0].stop();
+       assert_true(audio.ended, "Audio stream is ended after stopping its only audio track");
        assert_throws("INVALID_STATE_ERR", function () {
-          video.audioTracks.add(audio.audioTracks[0]);
+          video.addTrack(audio.getAudioTracks()[0]);
           }, "Adding a track from a finished stream raises an INVALID_STATE_ERR exception");
        assert_throws("INVALID_STATE_ERR", function () {
-          audio.audioTracks.remove(audio.audioTracks[0]);
+          audio.removeTrack(audio.getAudioTracks()[0]);
           }, "Removing a track from a finished stream raises an INVALID_STATE_ERR exception");
      });
     t.done();