/* 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 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ "use strict"; addAccessibleTask( `

p

a `, 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 } );