Bug 1615973 - Hide invoke getter popup when evaluating expression. r=Honza.

Differential Revision: https://phabricator.services.mozilla.com/D63062

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Chevobbe 2020-02-17 14:44:34 +00:00
Родитель ef367b4472
Коммит 4d901c42ef
2 изменённых файлов: 11 добавлений и 4 удалений

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

@ -8,7 +8,7 @@ const {
AUTOCOMPLETE_DATA_RECEIVE, AUTOCOMPLETE_DATA_RECEIVE,
AUTOCOMPLETE_PENDING_REQUEST, AUTOCOMPLETE_PENDING_REQUEST,
AUTOCOMPLETE_RETRIEVE_FROM_CACHE, AUTOCOMPLETE_RETRIEVE_FROM_CACHE,
APPEND_TO_HISTORY, EVALUATE_EXPRESSION,
UPDATE_HISTORY_POSITION, UPDATE_HISTORY_POSITION,
REVERSE_SEARCH_INPUT_CHANGE, REVERSE_SEARCH_INPUT_CHANGE,
REVERSE_SEARCH_BACK, REVERSE_SEARCH_BACK,
@ -89,12 +89,12 @@ function autocomplete(state = getDefaultState(), action) {
// Reset the autocomplete data when: // Reset the autocomplete data when:
// - clear is explicitely called // - clear is explicitely called
// - the user navigates the history // - the user navigates the history
// - or an item was added to the history (i.e. something was evaluated). // - or an expression was evaluated.
case AUTOCOMPLETE_CLEAR: case AUTOCOMPLETE_CLEAR:
return getDefaultState({ return getDefaultState({
authorizedEvaluations: state.authorizedEvaluations, authorizedEvaluations: state.authorizedEvaluations,
}); });
case APPEND_TO_HISTORY: case EVALUATE_EXPRESSION:
case UPDATE_HISTORY_POSITION: case UPDATE_HISTORY_POSITION:
case REVERSE_SEARCH_INPUT_CHANGE: case REVERSE_SEARCH_INPUT_CHANGE:
case REVERSE_SEARCH_BACK: case REVERSE_SEARCH_BACK:

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

@ -10,7 +10,7 @@ const TEST_URI = `data:text/html;charset=utf-8,
<script> <script>
window.foo = { window.foo = {
get rab() { get rab() {
return {}; return "rab";
} }
}; };
</script> </script>
@ -78,4 +78,11 @@ add_task(async function() {
true, true,
"The tooltip is now closed since the input doesn't match a getter name" "The tooltip is now closed since the input doesn't match a getter name"
); );
info("Check that evaluating the expression closes the tooltip");
tooltip = await setInputValueForGetterConfirmDialog(toolbox, hud, "foo.rab.");
EventUtils.sendString("length");
EventUtils.synthesizeKey("KEY_Enter");
await waitFor(() => !isConfirmDialogOpened(toolbox));
await waitFor(() => findMessage(hud, "3", ".result"));
ok("Expression was evaluated and tooltip was closed");
}); });