Commit 94f493f4 authored by Chris Cunningham's avatar Chris Cunningham Committed by Commit Bot

MediaCapabilities: Add bogus key system wpt test.

Adds a test to confirm that supported=false when the provided
keySystemConfig is unsupported. Ensures that the keySystemConfig is
unsupported by using a bogus keysystem name.

No bug; test passes. Just adding coverage.

Change-Id: I9d47ab59246bc29766ae5f60903e855517fad5ba
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2035633
Auto-Submit: Chrome Cunningham <chcunningham@chromium.org>
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738243}
parent 04a8dfde
......@@ -27,6 +27,11 @@ var minimalKeySystemConfiguration = {
keySystem: 'org.w3.clearkey',
};
// Config with bogus name not provided by any UA.
var bogusKeySystemConfiguration = {
keySystem: 'bogus',
};
promise_test(t => {
return navigator.mediaCapabilities.decodingInfo({
type: 'file',
......@@ -233,4 +238,16 @@ promise_test(t => {
});
}, "Test that keySystemAccess is only null when not supported if keySystemConfiguration was used.");
promise_test(t => {
return navigator.mediaCapabilities.decodingInfo({
type: 'file',
video: minimalVideoConfiguration,
audio: minimalAudioConfiguration,
// Supply bogus config to reliably result in a null keySystemAccess.
keySystemConfiguration: bogusKeySystemConfiguration,
}).then(ability => {
assert_equals(ability.keySystemAccess, null);
assert_false(ability.supported);
});
}, "Test that supported=false when keySystemConfiguration is unsupported.");
</script>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment