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

Unified Diff: third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html

Issue 1610473002: MediaRecorder: wire the bitRate settings in Blink and content (2nd go) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: peter@s comments Created 4 years, 11 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/mediarecorder/MediaRecorder-bitrates.html
diff --git a/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
new file mode 100644
index 0000000000000000000000000000000000000000..4fe68e375be9d5fe3a7f937ec0e86e6ac6bbc3ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/mediarecorder/MediaRecorder-bitrates.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src=../../resources/testharness.js></script>
+<script src=../../resources/testharnessreport.js></script>
+<script>
+// This test verifies that MediaRecorder can be created or not with different
+// bitrates for video, audio and for both [1].
+// TODO(mcasas): test also the expected allocated values once [2] is closed.
+// [1] https://rawgit.com/w3c/mediacapture-record/master/MediaRecorder.html#MediaRecorderOptions
+// [2] https://github.com/w3c/mediacapture-record/issues/43
+
+
+function makeAsyncTest(options, message) {
+ return async_test(function(test) {
+ const constraints = {video: true, audio: false};
+
+ const gotStream = test.step_func(function(stream) {
+ assert_throws("NotSupportedError",
+ function() {
+ var recorder = new MediaRecorder(stream, options);
+ },
+ "recorder rejects too large bit rates");
+ test.done();
+ });
+
+ const onError = this.step_func(function() {
+ assert_unreached('Error creating MediaStream.');
+ });
+
+ try {
+ navigator.webkitGetUserMedia(constraints, gotStream, onError);
+ }
+ catch (e) {
+ assert_unreached('Exception launching getUserMedia(): ' + e);
+ }
+ }, message);
+};
+
+makeAsyncTest({audioBitsPerSecond:4294967294}, 'Audio bitrate too large');
+makeAsyncTest({videoBitsPerSecond:4294967294}, 'Video bitrate too large');
+makeAsyncTest({bitsPerSecond:4294967294}, 'Overall bitrate too large');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698