Bug 1479521 - Only run browser_jsterm_accessibility.js with old jsterm; r=Honza.

Depends on D2826

Differential Revision: https://phabricator.services.mozilla.com/D2827

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2018-08-13 10:07:00 +00:00
Родитель 7a43defa74
Коммит f29e124ad5
1 изменённых файлов: 8 добавлений и 16 удалений

Просмотреть файл

@ -11,9 +11,10 @@
const TEST_URI = "data:text/html;charset=utf8,<p>test code completion";
add_task(async function() {
const hud = await openNewTabAndConsole(TEST_URI);
// Only run test with legacy JsTerm
await pushPref("devtools.webconsole.jsterm.codeMirror", false);
const jsterm = hud.jsterm;
const {jsterm} = await openNewTabAndConsole(TEST_URI);
const input = jsterm.inputNode;
info("Test that the console input is not treated as a live region");
@ -23,9 +24,12 @@ add_task(async function() {
ok(!input.hasAttribute("aria-activedescendant"), "no aria-activedescendant");
info("Type 'd' to open the autocomplete popup");
const onPopupOpen = jsterm.autocompletePopup.once("popup-opened");
autocomplete(jsterm, "d");
const {autocompletePopup} = jsterm;
const onPopupOpen = autocompletePopup.once("popup-opened");
EventUtils.sendString("d");
await onPopupOpen;
ok(autocompletePopup.isOpen && autocompletePopup.itemCount > 0,
"Autocomplete popup is open and contains suggestions");
info("Test the console input has an aria-activedescendant attribute");
ok(input.hasAttribute("aria-activedescendant"), "aria-activedescendant");
@ -59,18 +63,6 @@ add_task(async function() {
ok(!input.hasAttribute("aria-activedescendant"), "no aria-activedescendant");
});
async function autocomplete(jsterm, value) {
const popup = jsterm.autocompletePopup;
await new Promise(resolve => {
jsterm.setInputValue(value);
jsterm.complete(jsterm.COMPLETE_HINT_ONLY, resolve);
});
ok(popup.isOpen && popup.itemCount > 0,
"Autocomplete popup is open and contains suggestions");
}
function isElementInLiveRegion(element) {
if (!element) {
return false;