From 6949d7f72c52369bb1c75d630e2ed19aa3e0f1ce Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Thu, 30 Jul 2020 08:58:56 +0000 Subject: [PATCH] Bug 1655951 - Fix browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js failure. r=jdescottes. It seems that the test was failing because the focus wasn't on the console by the time we were trying to evaluate the input, so the Enter keypress wasn't registered and the input not evaluated. This is fixed by focusing the console input in `keyboardExecuteAndWaitForMessage`, before hitting Enter. Differential Revision: https://phabricator.services.mozilla.com/D85368 --- ...er_jsterm_evaluation_context_selector_pause_in_debugger.js | 4 ++++ devtools/client/webconsole/test/browser/head.js | 1 + 2 files changed, 5 insertions(+) diff --git a/devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js b/devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js index c1b57cda4d2b..31567d270b69 100644 --- a/devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js +++ b/devtools/client/webconsole/test/browser/browser_jsterm_evaluation_context_selector_pause_in_debugger.js @@ -61,6 +61,10 @@ add_task(async function() { ); ok(true, "Evaluation result is the expected one"); + // Cleanup + await clearOutput(hud); + setInputValue(hud, ""); + info("Resume the debugger"); await resume(dbg); diff --git a/devtools/client/webconsole/test/browser/head.js b/devtools/client/webconsole/test/browser/head.js index c50537510f83..fd18754f7c1b 100644 --- a/devtools/client/webconsole/test/browser/head.js +++ b/devtools/client/webconsole/test/browser/head.js @@ -307,6 +307,7 @@ function keyboardExecuteAndWaitForMessage( matchingText, selector = ".message" ) { + hud.jsterm.focus(); setInputValue(hud, input); const onMessage = waitForMessage(hud, matchingText, selector); if (isEditorModeEnabled(hud)) {