blob: e1096481bd4756667ede4d8714865ce5bca1e8b1 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src=../video-test.js></script>
<script type="text/javascript">
var promise;
var info;
async function doTest()
{
if (!window.internals) {
failTest("Internals is required for this test.")
return;
}
run('internals.enableMockMediaCapabilities()');
run('internals.settings.setMediaCapabilitiesExtensionsEnabled(true)');
run("promise = navigator.mediaCapabilities.decodingInfo({ type: 'file', video: { contentType: 'video/mp4; codecs=\"avc1\"', height: 720, bitrate: 1000, width: 1280, framerate: 24.5 }, unsupportedProperty: true });");
info = await shouldResolve(promise);
testExpected('info.supported', true);
testExpected('info.smooth', true);
testExpected('info.powerEfficient', true);
testExpected('typeof info.supportedConfiguration', 'undefined', '!=');
testExpected('info.supportedConfiguration.type', 'file');
testExpected('info.supportedConfiguration.video.contentType', 'video/mp4; codecs="avc1"');
testExpected('info.supportedConfiguration.video.height', 720);
testExpected('info.supportedConfiguration.video.bitrate', 1000);
testExpected('info.supportedConfiguration.video.width', 1280);
testExpected('info.supportedConfiguration.video.framerate', 24.5);
testExpected('typeof info.supportedConfiguration.unsupportedProperty', 'undefined');
run("promise = navigator.mediaCapabilities.decodingInfo({ type: 'media-source', video: { contentType: 'video/mp4; codecs=\"avc1\"', height: 720, bitrate: 1000, width: 1280, framerate: 24.5 }, unsupportedProperty: true });");
info = await shouldResolve(promise);
testExpected('info.supported', false);
testExpected('info.smooth', false);
testExpected('info.powerEfficient', false);
testExpected('typeof info.supportedConfiguration', 'undefined', '!=');
testExpected('info.supportedConfiguration.type', 'media-source');
testExpected('info.supportedConfiguration.video.contentType', 'video/mp4; codecs="avc1"');
testExpected('info.supportedConfiguration.video.height', 720);
testExpected('info.supportedConfiguration.video.bitrate', 1000);
testExpected('info.supportedConfiguration.video.width', 1280);
testExpected('info.supportedConfiguration.video.framerate', 24.5);
testExpected('typeof info.supportedConfiguration.unsupportedProperty', 'undefined');
endTest();
}
</script>
</head>
<body onload="doTest()" />
</html>