Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
-
CI results over the last 21 days
- This test runs only with pattern: os == 'linux' && !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";
function getInputValue(browser) {
return invokeContentTask(
browser,
[],
() => content.document.getElementById("input").value
);
}
/**
* Test the AtkEditableText methods on a text input.
*/
addAccessibleTask(
`<input id="input" value="abc">`,
async function testEditableText(browser) {
await runPython(`
global input
input = findByDomId(getDoc(), "input").queryEditableText()
`);
let changed = waitForEvent(EVENT_TEXT_VALUE_CHANGE, "input");
await runPython(`input.setTextContents("hello")`);
await changed;
is(await getInputValue(browser), "hello", "setTextContents worked");
changed = waitForEvent(EVENT_TEXT_VALUE_CHANGE, "input");
await runPython(`input.insertText(5, " world", 6)`);
await changed;
is(await getInputValue(browser), "hello world", "insertText worked");
changed = waitForEvent(EVENT_TEXT_VALUE_CHANGE, "input");
await runPython(`input.deleteText(0, 6)`);
await changed;
is(await getInputValue(browser), "world", "deleteText worked");
}
);