Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/embedded-content/media-elements/controlsList.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Test controlsList attribute</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
const allowedValues = [
"nodownload",
"nofullscreen",
"noplaybackrate",
"noremoteplayback",
];
function testControlsList(tagName) {
const element = document.createElement(tagName);
// Test that supports() is returning true for allowed values.
for (const value of allowedValues) {
assert_true(
element.controlsList.supports(value),
`tag = ${element.tagName}, value = ${value} must be supported`
);
}
}
["audio", "video"].forEach((tagName) => {
test(
() => testControlsList(tagName),
`Test controlsList allowed values for <${tagName}>`
);
});
</script>