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

Unified Diff: third_party/WebKit/LayoutTests/media_capabilities/encodingInfo.html

Issue 2811103006: Media Capabilities encoding: Blink pass-thru and skeleton renderer/ impl (Closed)
Patch Set: haraken@ comments Created 3 years, 8 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/media_capabilities/encodingInfo.html
diff --git a/third_party/WebKit/LayoutTests/media_capabilities/encodingInfo.html b/third_party/WebKit/LayoutTests/media_capabilities/encodingInfo.html
new file mode 100644
index 0000000000000000000000000000000000000000..cc9ffdb71708accdca0269926cb11a1c69df8985
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media_capabilities/encodingInfo.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<script src=../resources/testharness.js></script>
+<script src=../resources/testharnessreport.js></script>
+<script>
+
+// Check navigator.mediaCapabilities.encodingInfo() with some MIME types that
+// should be recordable and a few that shouldn't.
+
+var createTestForContentType = function(mimeType, isSupported = true) {
+ async_test(function(t) {
+ const media = mimeType.split('/')[0];
+ var queryParameters;
+ if (media == 'video') {
+ queryParameters = {
+ type : 'record',
+ video : {
+ contentType : mimeType,
+ width : 640,
+ height : 480,
+ bitrate : 10000,
+ framerate : 30
+ }
+ };
+ } else if (media == 'audio') {
+ queryParameters = {type : 'record', audio : {contentType : mimeType}};
+ } else {
+ assert_unreached('Unsupported media type');
+ }
+
+ navigator.mediaCapabilities.encodingInfo(queryParameters)
+ .then((result) => {
+ assert_equals(isSupported, result.supported, mimeType + 'supported?');
+ t.done();
+ })
+ .catch(() => {
+ assert_unreached('encodingInfo() ' + mimeType);
+ });
+ });
+};
+
+generate_tests(createTestForContentType, [
+ [ 'video/webm', 'video/webm' ],
+ [ 'video/webm;codecs=vp8', 'video/webm;codecs=vp8' ],
+ [ 'video/webm;codecs=vp9', 'video/webm;codecs=vp9' ],
+ [ 'video/webm;codecs=VP8.0', 'video/webm;codecs=vp8.0' ],
+ [ 'video/webm;codecs=vp9.0', 'video/webm;codecs=vp9.0' ],
+ [ 'video/webm;codecs=h264', 'video/webm;codecs=h264' ],
+ [ 'video/webm;codecs=H264', 'video/webm;codecs=H264' ],
+ [ 'video/webm;codecs=avc1', 'video/webm;codecs=avc1' ],
+ // 'video/webm' supports audio codec specification, see
+ // http://www.webmproject.org/docs/container/
+ [ 'video/webm;codecs=vp8,opus', 'video/webm;codecs=vp8,opus' ],
+ [ 'video/WEBM;codecs=VP8,OPUS', 'video/WEBM;codecs=VP8,OPUS' ],
+ [ 'video/webm;codecs=vp9,opus', 'video/webm;codecs=vp9,opus' ],
+ [ 'video/webm;codecs=vp8,vp9,opus', 'video/webm;codecs=vp8,vp9,opus' ],
+ [ 'video/webm;codecs=h264,opus', 'video/webm;codecs=h264,opus' ],
+ [ 'video/webm;codecs=h264,vp9,opus', 'video/webm;codecs=h264,vp9,opus' ],
+ // https://matroska.org/technical/specs/notes.html#MIME
+ [ 'video/x-matroska;codecs=vorbis', 'video/x-matroska;codecs=opus' ],
+ [ 'audio/webm', 'audio/webm' ],
+ [ 'audio/webm;codecs=opus', 'audio/webm;codecs=opus' ],
+
+ // Rejected MIME types
+ [ 'video/invalid', 'video/invalid', false],
+ [ 'video/mpeg4', 'video/mpeg4', false],
+ [ 'video/webm;codecs=daala', 'video/webm;codecs=daala', false],
+ [ 'audio/invalid', 'audio/invalid', false],
+ [ 'audio/ogg', 'audio/ogg', false],
+ [ 'audio/webm;codecs=vorbis', 'audio/webm;codecs=vorbis', false],
+]);
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698