Bug 1660392 - [l10nregistry] part10: Fix mozapps update test to await for gAppUpdater. r=application-update-reviewers,bytesized

Differential Revision: https://phabricator.services.mozilla.com/D121126
This commit is contained in:
Zibi Braniecki 2021-07-30 16:47:50 +00:00
parent 7e9ce81479
commit 9b6ec8c442
2 changed files with 7 additions and 4 deletions

View File

@ -187,9 +187,10 @@ add_task(async function testRememberedDecisionsUI() {
"rememberedList has expected number of labels"
);
// Some of the strings here are localized with Fluent, so they will only be
// available after the next refresh driver tick.
await new Promise(win.requestAnimationFrame);
await BrowserTestUtils.waitForCondition(
() => labels[10].textContent.length > 0,
"Localized label is populated"
);
let expectedHosts = [
"example.com",

View File

@ -664,7 +664,9 @@ function runAboutDialogUpdateTest(params, steps) {
const { panelId, checkActiveUpdate, continueFile, downloadInfo } = step;
return (async function() {
await TestUtils.waitForCondition(
() => aboutDialog.gAppUpdater.selectedPanel?.id == panelId,
() =>
aboutDialog.gAppUpdater &&
aboutDialog.gAppUpdater.selectedPanel?.id == panelId,
"Waiting for the expected panel ID: " + panelId,
undefined,
200