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> |