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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.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-creation.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.html b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.html
index d3da80d8b958f6fcd46bdc26985d46c427836c5c..57a29e6af3cb321522dae6088c8da39964ed9f51 100644
--- a/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.html
+++ b/third_party/WebKit/LayoutTests/fast/mediacapturefromelement/HTMLMediaElementCapture-creation.html
@@ -5,34 +5,29 @@
// Run captureStream() on <video>/<audio>s and inspect the generated Stream.
-test(function() {
- var video = document.createElement('video');
- assert_throws("NotSupportedError", function () { video.captureStream() },
- "captureStream() cannot be created out of a source-less <video>" );
-}, 'check that captureStream() raises an exception on a <video> with no source.');
-
-test(function() {
- var audio = document.createElement('audio');
- assert_throws("NotSupportedError", function () { audio.captureStream() },
- "captureStream() cannot be created out of a source-less <audio>" );
-}, 'check that captureStream() raises an exception on an <audio> with no source.');
-
-var makeAsyncTest = function(filename) {
+var makeAsyncTest = function(filename, numTracks) {
async_test(function() {
var video = document.createElement('video');
video.src = "../../http/tests/media/resources/media-source/webm/" + filename;
video.onerror = this.unreached_func("<video> error");
+ video.play();
+
+ var stream = video.captureStream();
+ assert_not_equals(stream, null, "error generating stream");
- video.onloadstart = this.step_func_done(function() {
- var stream = video.captureStream();
- assert_not_equals(stream, null, "error generating stream");
+ // onactive event is marked for deprecation (https://crbug.com/649328)
+ stream.onactive = this.step_func_done(function() {
+ // The stream got a (number of) MediaStreamTracks added.
+ assert_equals(stream.getVideoTracks().length, numTracks['vid'], 'video');
+ assert_equals(stream.getAudioTracks().length, numTracks['aud'], 'audio');
});
}), "<video>.captureStream()";
};
-generate_tests(makeAsyncTest,
- [[ "video-only", "test-v-128k-320x240-24fps-8kfr.webm"],
- [ "audio-only", "test-a-128k-44100Hz-1ch.webm"],
- [ "video+audio", "test.webm"]]);
+generate_tests(makeAsyncTest, [
+ [ "video-only", "test-v-128k-320x240-24fps-8kfr.webm", {vid : 1, aud : 0} ],
+ [ "audio-only", "test-a-128k-44100Hz-1ch.webm", {vid : 0, aud : 1} ],
+ [ "video+audio", "test.webm", {vid : 1, aud : 1} ]
+]);
</script>

Powered by Google App Engine
This is Rietveld 408576698