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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html

Issue 1599533003: MediaCaptureFromElement: add support for audio captureStream(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: using refptr iso WeakPtr Created 4 years, 7 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: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html
new file mode 100644
index 0000000000000000000000000000000000000000..120711bcfc9c7fdb4a536478b799c5275f5e16de
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+
+// Run captureStream() on different videos, and assert data is flowing.
+
+var makeAsyncTest = function(filename) {
+ async_test(function(test) {
+ var video = document.createElement('video');
+ video.src = "../../http/tests/media/resources/media-source/webm/" + filename;
+ video.onerror = this.unreached_func("<video> error");
+
+ video.onloadedmetadata = this.step_func(function() {
+ var stream = video.captureStream();
+ var recorder = new MediaRecorder(stream);
+ recorder.ondataavailable = test.step_func_done(function(event) {
+ assert_true(event.data.size > 0, 'Recorded data size should be > 0');
+ });
+
+ recorder.start();
+ video.play();
+
+ });
+
+ video.load();
+ }), "<video>.captureStream() and assert data flows.";
+};
+
+generate_tests(makeAsyncTest,
+ [[ "video-only", "test-v-128k-320x240-24fps-8kfr.webm"],
+ [ "audio-only", "test-a-128k-44100Hz-1ch.webm"],
+ [ "video+audio", "test.webm"]]);
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698