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

MozReview-Commit-ID: EaOSFmWa1tZ

--HG--
extra : rebase_source : bf5073d9372f6458f9085c5aaa9e8c8e3f8bcf5a
This commit is contained in:
Nicolas Chevobbe 2018-07-25 10:58:01 +02:00
Родитель fce95f5a2c
Коммит 3ffd4df54c
4 изменённых файлов: 10 добавлений и 9 удалений

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

@ -64,7 +64,8 @@ function test() {
// (Must happen after generateMouseClickInTab() call)
let consoleLostFocus = false;
jsterm.focus();
jsterm.inputNode.addEventListener("blur", () => {consoleLostFocus = true;});
const node = jsterm.inputNode || jsterm.node;
node.addEventListener("blur", () => {consoleLostFocus = true;});
is(gThreadClient.paused, true,
"Should be paused at debugger statement.");

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

@ -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();
}

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

@ -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,

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

@ -25,7 +25,6 @@ add_task(async function() {
async function performTests() {
let toolbox;
await pushPref("devtools.webconsole.jsterm.codeMirror", true);
await addTab(TEST_URI);
await testConsoleLoadOnDifferentPanel();
await testKeyboardShortcuts();