Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os != 'linux' OR headless
- Manifest: accessible/tests/browser/atk/browser.toml
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
"use strict";
addAccessibleTask(
`
<p id="p">p</p>
<input id="range_input" type="range" min="0" max="10" value="8">
<input id="text_input" type="text" value="hello">
<button id="button">hello</button>`,
async function testInterfaces() {
await runPython(`
global doc
doc = getDoc()
`);
async function checkInterfaces(id, expectedInterfaces) {
let interfaces = await runPython(`
return findByDomId(doc, "${id}").get_interfaces()
`);
Assert.deepEqual(
expectedInterfaces.slice().sort(),
interfaces.sort(),
`Correct interfaces for "${id}"`
);
}
await checkInterfaces("p", [
"Accessible",
"Collection",
"Component",
"EditableText",
"Hyperlink",
"Hypertext",
"Text",
]);
await checkInterfaces("link", [
"Accessible",
"Action",
"Collection",
"Component",
"EditableText",
"Hyperlink",
"Hypertext",
"Text",
]);
await checkInterfaces("range_input", [
"Accessible",
"Collection",
"Component",
"Hyperlink",
"Value",
]);
await checkInterfaces("text_input", [
"Accessible",
"Action",
"Collection",
"Component",
"EditableText",
"Hyperlink",
"Hypertext",
"Text",
]);
await checkInterfaces("button", [
"Accessible",
"Action",
"Collection",
"Component",
"EditableText",
"Hyperlink",
"Hypertext",
"Text",
]);
},
{ chrome: true, topLevel: true }
);