From aaaad9dd6d6f27ac4399252e6c45a250dd668a24 Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Mon, 23 Oct 2017 09:07:14 +0200 Subject: [PATCH] Bug 1408918 - Rename and enable browser_webconsole_autocomplete_accessibility.js in new console frontend; r=Honza MozReview-Commit-ID: CknvP7M1rVJ --HG-- rename : devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_autocomplete_accessibility.js => devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_accessibility.js extra : rebase_source : 4e755ebedb6360991b820a61a53544c604def4c4 --- .../test/mochitest/browser.ini | 3 +-- ...bility.js => browser_jsterm_accessibility.js} | 16 +++++++--------- 2 files changed, 8 insertions(+), 11 deletions(-) rename devtools/client/webconsole/new-console-output/test/mochitest/{browser_webconsole_autocomplete_accessibility.js => browser_jsterm_accessibility.js} (85%) diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini index d0beb05dbe2e..acfff92bd456 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser.ini @@ -195,6 +195,7 @@ skip-if = true # Bug 1406060 [browser_console_webconsole_private_browsing.js] skip-if = true # Bug 1403188 # old console skip-if = e10s # Bug 1042253 - webconsole e10s tests +[browser_jsterm_accessibility.js] [browser_jsterm_add_edited_input_to_history.js] [browser_jsterm_autocomplete_helpers.js] [browser_jsterm_autocomplete-properties-with-non-alphanumeric-names.js] @@ -212,8 +213,6 @@ skip-if = true # Bug 1403452 # old console skip-if = (os == 'win' && bits == 64) # Bug 1390001 [browser_webconsole_assert.js] skip-if = true # Bug 1403458 -[browser_webconsole_autocomplete_accessibility.js] -skip-if = true # Bug 1408918 [browser_webconsole_autocomplete_and_selfxss.js] subsuite = clipboard skip-if = true # Bug 1404850 diff --git a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_autocomplete_accessibility.js b/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_accessibility.js similarity index 85% rename from devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_autocomplete_accessibility.js rename to devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_accessibility.js index bcd2e22d0fb8..033d2d7f6df8 100644 --- a/devtools/client/webconsole/new-console-output/test/mochitest/browser_webconsole_autocomplete_accessibility.js +++ b/devtools/client/webconsole/new-console-output/test/mochitest/browser_jsterm_accessibility.js @@ -10,16 +10,14 @@ const TEST_URI = "data:text/html;charset=utf8,

test code completion"; -add_task(function* () { - yield loadTab(TEST_URI); - - let hud = yield openConsole(); +add_task(async function () { + let hud = await openNewTabAndConsole(TEST_URI); let jsterm = hud.jsterm; let input = jsterm.inputNode; info("Type 'd' to open the autocomplete popup"); - yield autocomplete(jsterm, "d"); + await autocomplete(jsterm, "d"); // Add listeners for focus and blur events. let wasBlurred = false; @@ -30,7 +28,7 @@ add_task(function* () { }); let wasFocused = false; - input.addEventListener("blur", () => { + input.addEventListener("focus", () => { ok(wasBlurred, "jsterm input received a blur event before received back the focus"); wasFocused = true; }, { @@ -42,15 +40,15 @@ add_task(function* () { EventUtils.synthesizeKey("VK_TAB", {}); info("Wait for the autocomplete popup to be closed"); - yield onPopupClosed; + await onPopupClosed; ok(wasFocused, "jsterm input received a focus event"); }); -function* autocomplete(jsterm, value) { +async function autocomplete(jsterm, value) { let popup = jsterm.autocompletePopup; - yield new Promise(resolve => { + await new Promise(resolve => { jsterm.setInputValue(value); jsterm.complete(jsterm.COMPLETE_HINT_ONLY, resolve); });