Chromium Code Reviews| 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."); |
|
hta - Chromium
2015/01/14 14:12:02
While you're at it, can you fix this to be a gramm
|
| 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.'); |
|
hta - Chromium
2015/01/14 14:12:02
Also check that active is false here.
|
| + 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; |
|
hta - Chromium
2015/01/14 14:12:02
Also check that active is true here.
|
| + 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; |