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
This commit is contained in:
Nicolas Chevobbe 2018-08-14 17:09:20 +00:00
Родитель 8e541f1e0a
Коммит 4e0edfeca2
1 изменённых файлов: 16 добавлений и 0 удалений

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

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