Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 3 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/permission-element/roles.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset=utf-8>
<title>Capability elements have button role</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<body>
<!--
All capability elements (subclasses of HTMLCapabilityElementBase) must have
the button accessibility role. When adding a new capability element, add it
to the list below.
-->
<install id="install_element"></install>
<usermedia id="usermedia_element" type="camera"></usermedia>
<geolocation id="geolocation_element"></geolocation>
<script>
// Update this list when a new capability element is added.
const capabilityElements = [
"install_element",
"usermedia_element",
"geolocation_element",
];
for (const id of capabilityElements) {
const el = document.getElementById(id);
promise_test(async t => {
const role = await test_driver.get_computed_role(el);
assert_equals(role, "button");
}, `${el.tagName.toLowerCase()} element has button role`);
}
</script>
</body>