Bug 1445837 - Fix race condition in toolkit/components/printing/tests/browser_preview_print_simplify_non_article.js. r?mconley
This patch address a race condition issue for toolkit/components/printing/tests/
browser_preview_print_simplify_non_article.js test added in
bug 1440638.
MozReview-Commit-ID: 4X17u2CP4ea
--- a/toolkit/components/printing/tests/browser_preview_print_simplify_non_article.js
+++ b/toolkit/components/printing/tests/browser_preview_print_simplify_non_article.js
@@ -60,17 +60,18 @@ add_task(async function switch_print_pre
await simplifiedPPEntered;
// Assert that simplify page option is checked
is(printPreviewToolbar.mSimplifyPageCheckbox.checked, true,
"Should have simplify page option checked");
// Assert that we are showing recovery content on simplified print preview browser
await ContentTask.spawn(simplifiedPPBrowser, null, async function() {
- is(content.document.title, "Failed to load article from page", "Should have recovery content.");
+ await ContentTaskUtils.waitForCondition(() => content.document.title === "Failed to load article from page",
+ "Simplified document title should be updated with recovery title.");
});
// Assert that we are selecting simplified print preview browser, and not default one
is(gBrowser.selectedTab.linkedBrowser, simplifiedPPBrowser,
"Should have simplified print preview browser selected");
isnot(gBrowser.selectedTab.linkedBrowser, defaultPPBrowser,
"Should not have default print preview browser selected");