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

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: esprehn@ last comments Created 5 years, 3 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
« no previous file with comments | « no previous file | LayoutTests/fast/mediarecorder/MediaRecorder-basic-video-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..40e9bb57c2055332cd434882a95d23bbbdf2d16b
--- /dev/null
+++ b/LayoutTests/fast/mediarecorder/MediaRecorder-basic-video.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+
+var test = async_test('checks the video-only MediaRecorder API.');
+
+recorderOnDataAvailable = test.step_func(function(event) {
+ assert_greater_than(event.data.size, 0, 'Recorded data size should be > 0');
+ assert_eq(recorder.state, "recording");
+
+ // TODO(mcasas): Let the test record for a while.
+ // TODO(mcasas): Consider storing the recorded data and playing it back.
+
+ test.done();
+});
+
+recorderOnStop = test.step_func(function() {
+ assert_unreached('Recording stopped.');
+});
+
+gotStream = test.step_func(function(s) {
+ stream = s;
+ assert_equals(stream.getAudioTracks().length, 0);
+ assert_equals(stream.getVideoTracks().length, 1);
+
+ try {
+ recorder = new MediaRecorder(stream);
+ } catch (e) {
+ assert_unreached('Exception while creating MediaRecorder: ' + e);
+ }
+
+ assert_eq(recorder.state, "inactive");
+ recorder.ondataavailable = recorderOnDataAvailable;
+ recorder.onstop = recorderOnStop;
+ recorder.start();
+});
+
+onError = test.step_func(function() {
+ assert_unreached('Error creating MediaRecorder.');
+});
+
+try {
+ navigator.webkitGetUserMedia({video:true}, gotStream, onError);
+} catch(e) {
+ assert_unreached('Exception launching getUserMedia(): ' + e);
+}
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/mediarecorder/MediaRecorder-basic-video-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698