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

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

Issue 2110573002: MediaCaptureFromElement: add captureStreamUntilEnded() and LayoutTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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-captureStreamUntilEnded.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-captureStreamUntilEnded.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-captureStreamUntilEnded.html
new file mode 100644
index 0000000000000000000000000000000000000000..9c841c4914aed9e4624a3f1173f25bdff753c612
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-captureStreamUntilEnded.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+
+// Run captureStreamUntilEnded() on different videos, and assert onEnded is fired.
+
+var makeAsyncTest = function(filename) {
+ async_test(function(test) {
+ var stream;
+
+ 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() {
+ stream = video.captureStreamUntilEnded();
+ stream.oninactive = test.step_func_done(function() {});
+
+ video.play();
+ });
+ video.onplay = this.step_func(function() {
+ // Skip forward till almost the end of the video to speed up the test.
+ video.currentTime = video.duration - 0.1;
+ });
+
+ video.load();
+ }), "<video>.captureStreamUntilEnded() and assert data flows.";
+};
+
+generate_tests(makeAsyncTest,
+ [[ "video-only", "test-v-128k-320x240-24fps-8kfr.webm"],
+ [ "audio-only", "test-a-128k-44100Hz-1ch.webm"]]);
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698