Bug 1710123 - [devtools] Fix browser_accessibility_reload.js intermittent. r=bomsy.

The test wasn't waiting for the panel to be properly reloaded.

Differential Revision: https://phabricator.services.mozilla.com/D122363
This commit is contained in:
Nicolas Chevobbe 2021-08-12 05:34:25 +00:00
Родитель ff35a3938d
Коммит d50491b943
1 изменённых файлов: 9 добавлений и 3 удалений

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

@ -59,8 +59,11 @@ const tests = [
},
{
desc: "Reload the page.",
setup: async ({ panel }) =>
panel.accessibilityProxy.commands.targetCommand.reloadTopLevelTarget(),
setup: async ({ panel }) => {
const onReloaded = panel.once("reloaded");
panel.accessibilityProxy.commands.targetCommand.reloadTopLevelTarget();
await onReloaded;
},
expected: {
tree: [
{
@ -76,7 +79,10 @@ const tests = [
},
{
desc: "Navigate to a new page.",
setup: () => navigateTo(buildURL(TEST_URI_2)),
setup: async () => {
// `navigate` waits for the "reloaded" event so we don't need to do it explicitly here
await navigateTo(buildURL(TEST_URI_2));
},
expected: {
tree: [
{