From 4e0edfeca2c53293edabffcad4e03b2efcdee5ba Mon Sep 17 00:00:00 2001 From: Nicolas Chevobbe Date: Tue, 14 Aug 2018 17:09:20 +0000 Subject: [PATCH] Bug 1483212 - Fix DAMP webconsole autocomplete test on Beta; r=bgrins. In beta, we still have the old jsterm, so we need to adjust the test code in this case. Which means reverting back to what we were doing: manually triggering the autocompletion start by calling updateAutoCompletion. Differential Revision: https://phabricator.services.mozilla.com/D3350 --HG-- extra : moz-landing-system : lando --- .../content/tests/webconsole/autocomplete.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/testing/talos/talos/tests/devtools/addon/content/tests/webconsole/autocomplete.js b/testing/talos/talos/tests/devtools/addon/content/tests/webconsole/autocomplete.js index ebd0b4767971..74697b947a2a 100644 --- a/testing/talos/talos/tests/devtools/addon/content/tests/webconsole/autocomplete.js +++ b/testing/talos/talos/tests/devtools/addon/content/tests/webconsole/autocomplete.js @@ -54,15 +54,31 @@ async function showAndHideAutoCompletePopup(jsterm) { async function triggerAutocompletePopup(jsterm) { const onPopupOpened = jsterm.autocompletePopup.once("popup-opened"); jsterm.setInputValue("window.autocompleteTest."); + if (!jsterm.editor) { + // setInputValue does not trigger the autocompletion in the old jsterm; + // we need to call `updateAutocompletion` in order to display the popup. And since + // setInputValue sets lastInputValue and updateAutocompletion checks it to trigger + // the autocompletion request, we reset it. + jsterm.lastInputValue = null; + jsterm.updateAutocompletion(); + } await onPopupOpened; const onPopupUpdated = jsterm.once("autocomplete-updated"); jsterm.setInputValue("window.autocompleteTest.item9"); + if (!jsterm.editor) { + jsterm.lastInputValue = null; + jsterm.updateAutocompletion(); + } await onPopupUpdated; } function hideAutocompletePopup(jsterm) { let onPopUpClosed = jsterm.autocompletePopup.once("popup-closed"); jsterm.setInputValue(""); + if (!jsterm.editor) { + jsterm.lastInputValue = null; + jsterm.updateAutocompletion(); + } return onPopUpClosed; }