/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
/** *Testbasicpressaction.
*/
addAccessibleTask(
`
<button id="btn" onclick="this.textContent = 'Clicked'">Click me</button>
`,
async function testBasicPress() { const actions = await runPython(`
global doc
doc = getDocIa2()
global btn
btn = findIa2ByDomId(doc, "btn").QueryInterface(IAccessibleAction)
return str([[btn.name(i), btn.localizedName(i), btn.description(i)] for i in range(btn.nActions())])
`);
is(actions, "[['press', 'Press', 'Press']]", "btn has correct actions");
// Test dialog with its own click listener, and therefore has the aria-actions // target actions appended to its own actions.
actions = await runPython(`
global dlg2
dlg2 = findIa2ByDomId(doc, "dlg2").QueryInterface(IAccessibleAction)
return str([[dlg2.name(i), dlg2.localizedName(i), dlg2.description(i)] for i in range(dlg2.nActions())])
`);
is(
actions, "[['click', 'Click', 'Click'], ['custom_btn2', 'Close', 'Close']]", "dlg2 has correct actions"
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.