| Index: LayoutTests/fast/mediastream/MediaStream-stop.html
|
| diff --git a/LayoutTests/fast/mediastream/MediaStream-stop.html b/LayoutTests/fast/mediastream/MediaStream-stop.html
|
| index d8afe6ffa17e008a6f55f191f0d468c4838b295f..1e516ec348b21b81fd01cd7ae9ea5e54822b2f86 100644
|
| --- a/LayoutTests/fast/mediastream/MediaStream-stop.html
|
| +++ b/LayoutTests/fast/mediastream/MediaStream-stop.html
|
| @@ -5,28 +5,41 @@
|
| </head>
|
| <body>
|
| <script>
|
| -description("Test cloning mediastreams onended.");
|
| +description("Test cloning mediastreams oninactive.");
|
|
|
| var cloned_stream;
|
|
|
| -function onStreamEnded() {
|
| - testPassed('Stream ended.');
|
| +function error() {
|
| + testFailed('Stream generation failed.');
|
| finishJSTest();
|
| }
|
|
|
| -function onTrackAdded() {
|
| - testPassed('Mock test track added.');
|
| - shouldBe('cloned_stream.getVideoTracks().length', '1');
|
| - cloned_stream.getVideoTracks()[0].stop();
|
| +function getUserMedia(dictionary, callback) {
|
| + try {
|
| + navigator.webkitGetUserMedia(dictionary, callback, error);
|
| + } catch (e) {
|
| + testFailed('webkitGetUserMedia threw exception :' + e);
|
| + finishJSTest();
|
| + }
|
| +}
|
| +
|
| +function onStreamInactive() {
|
| + testPassed('Stream inactive.');
|
| + finishJSTest();
|
| }
|
|
|
| -function run(s) {
|
| - cloned_stream = new webkitMediaStream();
|
| - cloned_stream.onaddtrack = onTrackAdded;
|
| - cloned_stream.onended = onStreamEnded;
|
| +function gotStream(s) {
|
| + stream = s;
|
| +
|
| + cloned_stream = stream.clone();
|
| + cloned_stream.oninactive = onStreamInactive;
|
| + shouldBe('cloned_stream.getVideoTracks().length', '1');
|
| + shouldBe('cloned_stream.getAudioTracks().length', '1');
|
| + cloned_stream.getVideoTracks()[0].stop();
|
| + cloned_stream.getAudioTracks()[0].stop();
|
| }
|
|
|
| -run();
|
| +getUserMedia({audio:true, video:true}, gotStream);
|
|
|
| window.jsTestIsAsync = true;
|
| window.successfullyParsed = true;
|
|
|