Chromium Code Reviews| Index: LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html |
| diff --git a/LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html b/LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ca7452e2e2093a4ba85c49baeb04fee599f9db17 |
| --- /dev/null |
| +++ b/LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html |
| @@ -0,0 +1,62 @@ |
| +<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| +<html> |
| +<head> |
|
esprehn
2015/08/12 22:27:34
leave out html, head and body.
mcasas
2015/08/13 09:31:50
Done.
|
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<p id="description"></p> |
| +<div id="console"></div> |
|
esprehn
2015/08/12 22:27:34
it creates these for you, leave out description an
mcasas
2015/08/13 09:31:50
Done.
|
| +<script> |
| +description("This Test checks the video-only MediaRecorder API."); |
| + |
| +var stream; |
| +var recorder; |
| + |
| +function onError() { |
| + testFailed('Error callback called.'); |
| + finishJSTest(); |
| +} |
| + |
| +function recorderOnStart() { |
| + testPassed('Recording started.'); |
| +} |
| + |
| +function recorderOnDataAvailable(event) { |
| + testPassed('Recorded data received, size: ' + event.data.size); |
| + shouldBeGreaterThan('event.data.size', '0'); |
| + |
| + // TODO(mcasas): Let the test record for a while. |
| + // TODO(mcasas): Consider storing the recorded data and playing it back. |
| + |
| + testPassed('Some data recorded.'); |
| + finishJSTest(); |
| +} |
| + |
| +function recorderOnStop() { |
| + testFailed('Recording stopped.'); |
| + recorder = null |
| + finishJSTest() |
| +} |
| + |
| +function gotStream(s) { |
| + stream = s; |
| + testPassed('Stream generated.'); |
| + shouldBe('stream.getAudioTracks().length', '0'); |
| + shouldBe('stream.getVideoTracks().length', '1'); |
| + |
| + shouldNotThrow("recorder = new MediaRecorder(stream);"); |
| + if (!recorder) |
| + finishJSTest(); |
| + shouldNotThrow("recorder.onstart = recorderOnStart;"); |
| + shouldNotThrow("recorder.ondataavailable = recorderOnDataAvailable;"); |
| + shouldNotThrow("recorder.onstop = recorderOnStop;"); |
| + shouldNotThrow("recorder.start();"); |
| +} |
| + |
| +shouldNotThrow("navigator.webkitGetUserMedia({video:true}, gotStream, onError);"); |
| + |
| +window.jsTestIsAsync = true; |
|
esprehn
2015/08/12 22:27:34
Move to top.
mcasas
2015/08/13 09:31:50
Done.
|
| +window.successfullyParsed = true; |
|
esprehn
2015/08/12 22:27:34
Don't set this yourself, it should do it for you.
mcasas
2015/08/13 09:31:50
Done.
|
| +</script> |
| +</body> |
| +</html> |