Bug 1470922 - Fix tests failing with the new Jsterm; r=bgrins.

MozReview-Commit-ID: EaOSFmWa1tZ

--HG--
extra : rebase_source : 7a499966af0bb4f318fa6d66c8e714a40207e638
This commit is contained in:
Nicolas Chevobbe 2018-07-25 10:58:01 +02:00
parent ed14a440a5
commit 272f14e3e5
2 changed files with 8 additions and 7 deletions

View File

@ -52,8 +52,7 @@ function testUseKeyWithSplitConsole() {
}, "jsdebugger");
info("synthesizeKey with the console focused");
const consoleInput = gToolbox.getPanel("webconsole").hud.jsterm.inputNode;
consoleInput.focus();
focusConsoleInput();
synthesizeKeyShortcut("F3", panelWin);
ok(commandCalled, "Shortcut key should trigger the command");
@ -69,8 +68,7 @@ function testUseKeyWithSplitConsoleWrongTool() {
}, "inspector");
info("synthesizeKey with the console focused");
const consoleInput = gToolbox.getPanel("webconsole").hud.jsterm.inputNode;
consoleInput.focus();
focusConsoleInput();
synthesizeKeyShortcut("F4", panelWin);
ok(!commandCalled, "Shortcut key shouldn't trigger the command");
@ -81,3 +79,7 @@ async function cleanup() {
gBrowser.removeCurrentTab();
gToolbox = panelWin = null;
}
function focusConsoleInput() {
gToolbox.getPanel("webconsole").hud.jsterm.focus();
}

View File

@ -28,8 +28,7 @@ add_task(async function() {
const hud = toolbox.getPanel("webconsole").hud;
const jsterm = hud.jsterm;
const jstermInput = jsterm.hud.document.querySelector(".jsterm-input-node");
is(jstermInput.value, "temp0", "first console variable is named temp0");
is(jsterm.getInputValue(), "temp0", "first console variable is named temp0");
let result = await jsterm.execute();
isnot(result.textContent.indexOf('<p id="console-var">'), -1,
@ -39,7 +38,7 @@ add_task(async function() {
menuItem.click();
await inspector.once("console-var-ready");
is(jstermInput.value, "temp1", "second console variable is named temp1");
is(jsterm.getInputValue(), "temp1", "second console variable is named temp1");
result = await jsterm.execute();
isnot(result.textContent.indexOf('<p id="console-var-multi">'), -1,