зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1661921 - [devtools] Console Instant Value no refresh after page refresh r=nchevobbe
Differential Revision: https://phabricator.services.mozilla.com/D139770
This commit is contained in:
Родитель
a664a6d305
Коммит
2e0db4918d
|
@ -348,4 +348,20 @@ add_task(async function() {
|
|||
"Pref was changed"
|
||||
);
|
||||
ok(true, "Eager evaluation element is no longer displayed");
|
||||
|
||||
// reset the preference
|
||||
await pushPref(EAGER_EVALUATION_PREF, true);
|
||||
});
|
||||
|
||||
// Test that the console instant evaluation is updated on page navigation
|
||||
add_task(async function() {
|
||||
const start_uri = "data:text/html, Start uri";
|
||||
const new_uri = "data:text/html, Test console refresh instant value";
|
||||
const hud = await openNewTabAndConsole(start_uri);
|
||||
|
||||
setInputValue(hud, "globalThis.location.href");
|
||||
await waitForEagerEvaluationResult(hud, `"${start_uri}"`);
|
||||
|
||||
await navigateTo(new_uri);
|
||||
await waitForEagerEvaluationResult(hud, `"${new_uri}"`);
|
||||
});
|
||||
|
|
|
@ -414,6 +414,9 @@ class WebConsoleUI {
|
|||
* object by the page itself.
|
||||
*/
|
||||
async handleNavigated({ hasNativeConsoleAPI }) {
|
||||
// Updates instant evaluation on page navigation
|
||||
this.wrapper.dispatchUpdateInstantEvaluationResultForCurrentExpression();
|
||||
|
||||
// Wait for completion of any async dispatch before notifying that the console
|
||||
// is fully updated after a page reload
|
||||
await this.wrapper.waitAsyncDispatches();
|
||||
|
|
|
@ -290,6 +290,10 @@ class WebConsoleWrapper {
|
|||
store.dispatch(actions.evaluateExpression(expression));
|
||||
}
|
||||
|
||||
dispatchUpdateInstantEvaluationResultForCurrentExpression() {
|
||||
store.dispatch(actions.updateInstantEvaluationResultForCurrentExpression());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a Promise that resolves once any async dispatch is finally dispatched.
|
||||
*/
|
||||
|
|
Загрузка…
Ссылка в новой задаче