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

Unified Diff: media/test/data/decode_capabilities_test.html

Issue 2805553004: Wire up MediaCapabilities is_supported to MimeUtil (Closed)
Patch Set: Remove test for theora - not supported on android 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: media/test/data/decode_capabilities_test.html
diff --git a/media/test/data/decode_capabilities_test.html b/media/test/data/decode_capabilities_test.html
new file mode 100644
index 0000000000000000000000000000000000000000..6b0191a02d02b3b293c3ad7f97bf695a4ea8d558
--- /dev/null
+++ b/media/test/data/decode_capabilities_test.html
@@ -0,0 +1,72 @@
+<!DOCTYPE html>
+<title>Decode Capabilities Test</title>
+<div id="console"></div>
+<script type='text/javascript'>
+ function log(message) {
+ let consoleElement = document.getElementById('console');
+ let entry = document.createElement('div');
+ entry.appendChild(document.createTextNode(message));
+ consoleElement.appendChild(entry);
+ console.log(message);
+ }
+
+ function runTest(configuration) {
+ try {
+ navigator.mediaCapabilities.decodingInfo(configuration)
+ .then((result) => {
+ log('Decoding is '
+ + (result.supported ? '' : 'un') + 'supported');
+
+ document.title = result.supported ? 'SUPPORTED' : 'UNSUPPORTED';
+ })
+ .catch((e) => {
+ log('Promise rejected: ' + e);
+ document.title = "ERROR";
+ });
+
+ } catch (e) {
+ log('Exception:' + e);
+ document.title = "ERROR";
+ }
+ }
+
+ function testVideoDecodeContentType(contentType) {
+ // Clear previous test result from title.
+ document.title = '';
+
+ log("Testing video content type: " + contentType);
+
+ const configuration = {
+ // TODO(chcunningham): Add tests for type: "media-source".
+ type : 'file',
+ video : {
+ contentType : contentType,
+
+ // Any reasonable value will do.
+ width : 640,
+ height : 480,
+ bitrate : 10000,
+ framerate : 30
+ }
+ };
+
+ runTest(configuration);
+ }
+
+ function testAudioDecodeContentType(contentType) {
+ // Clear previous test result from title.
+ document.title = '';
+
+ log("Testing audio content type: " + contentType);
+
+ const configuration = {
+ // TODO(chcunningham): Add tests for type: "media-source".
+ type : 'file',
+ audio : {
+ contentType : contentType
+ }
+ };
+
+ runTest(configuration);
+ }
+</script>

Powered by Google App Engine
This is Rietveld 408576698