Bug 1750273 - [devtools] Fix intermittent failures in browser_jsterm_evaluation_context_selector_targets_update.js. r=bomsy.

Wait for "host-changed" events in the test so things are settled when the
toolbox gets destroyed.

Differential Revision: https://phabricator.services.mozilla.com/D137669
This commit is contained in:
Nicolas Chevobbe 2022-02-03 06:15:13 +00:00
Родитель 8754f82979
Коммит 25f744e03a
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -169,11 +169,13 @@ add_task(async function() {
info("Open a popup");
const originalTab = gBrowser.selectedTab;
let onSwitchedHost = hud.toolbox.once("host-changed");
await ContentTask.spawn(gBrowser.selectedBrowser, [IFRAME_PATH], function(
path
) {
content.open(`https://test2.example.org/${path}?id=popup`);
});
await onSwitchedHost;
// Wait until the popup is rendered in the context selector
// and that it is automatically switched to (aria-checked==true).
@ -217,11 +219,13 @@ add_task(async function() {
ok(true, "The context was set to the popup document");
info("Open a second popup and reload the original tab");
onSwitchedHost = hud.toolbox.once("host-changed");
await ContentTask.spawn(originalTab.linkedBrowser, [IFRAME_PATH], function(
path
) {
content.open(`https://test2.example.org/${path}?id=popup2`);
});
await onSwitchedHost;
// Reloading the tab while having two popups opened used to
// generate exception in the context selector component