forked from mirrors/gecko-dev
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:
parent
8e541f1e0a
commit
4e0edfeca2
1 changed files with 16 additions and 0 deletions
|
|
@ -54,15 +54,31 @@ async function showAndHideAutoCompletePopup(jsterm) {
|
||||||
async function triggerAutocompletePopup(jsterm) {
|
async function triggerAutocompletePopup(jsterm) {
|
||||||
const onPopupOpened = jsterm.autocompletePopup.once("popup-opened");
|
const onPopupOpened = jsterm.autocompletePopup.once("popup-opened");
|
||||||
jsterm.setInputValue("window.autocompleteTest.");
|
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;
|
await onPopupOpened;
|
||||||
|
|
||||||
const onPopupUpdated = jsterm.once("autocomplete-updated");
|
const onPopupUpdated = jsterm.once("autocomplete-updated");
|
||||||
jsterm.setInputValue("window.autocompleteTest.item9");
|
jsterm.setInputValue("window.autocompleteTest.item9");
|
||||||
|
if (!jsterm.editor) {
|
||||||
|
jsterm.lastInputValue = null;
|
||||||
|
jsterm.updateAutocompletion();
|
||||||
|
}
|
||||||
await onPopupUpdated;
|
await onPopupUpdated;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideAutocompletePopup(jsterm) {
|
function hideAutocompletePopup(jsterm) {
|
||||||
let onPopUpClosed = jsterm.autocompletePopup.once("popup-closed");
|
let onPopUpClosed = jsterm.autocompletePopup.once("popup-closed");
|
||||||
jsterm.setInputValue("");
|
jsterm.setInputValue("");
|
||||||
|
if (!jsterm.editor) {
|
||||||
|
jsterm.lastInputValue = null;
|
||||||
|
jsterm.updateAutocompletion();
|
||||||
|
}
|
||||||
return onPopUpClosed;
|
return onPopUpClosed;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue