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

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

Issue 2727583007: HTMLMediaElement capture: teach the captured MStream to follow up source events (Closed)
Patch Set: haraken@ comments Created 3 years, 9 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-ended.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-ended.html
similarity index 56%
copy from third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html
copy to third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-ended.html
index 420e3959309daaa64ecc43883bf7c8f59c4d7032..bf49be230338aec88176fe2a4a3d6ec6486b556f 100644
--- a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-capture.html
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-ended.html
@@ -3,28 +3,25 @@
<script src=../../resources/testharnessreport.js></script>
<script>
-// Run captureStream() on different videos, and assert data is flowing.
+// Run captureStream() on different videos, and assert the mediastream is
+// ended when the source HTMLMediaElement finishes
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.play();
- 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(0);
- video.play();
+ var stream = video.captureStream();
+ stream.onremovetrack = this.step_func_done(function() {
+ assert_true(video.ended, 'video must be ended');
+ assert_equals(stream.getTracks().length, 0, 'stream must have no tracks');
+ assert_false(stream.active, 'stream must be inactive');
});
- video.load();
- }), "<video>.captureStream() and assert data flows.";
+ }), "<video>.captureStream() and assert data flows.";
};
generate_tests(makeAsyncTest, [

Powered by Google App Engine
This is Rietveld 408576698