Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Unified Diff: LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html

Issue 1255873002: MediaRecorder Blink part (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tommi@s comments. Added dummy Source/platform/exported/WebMediaRecorderHandlerClient.cpp Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698