mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
Bug 1552714 - Fix two tests which were caught not waiting for l10n but checking for l10n values. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D33741 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
a49f5263f1
commit
70e5a4ee3a
@ -69,6 +69,15 @@ var waitForLoad = async function(uri) {
|
||||
gBrowser.selectedBrowser.webNavigation.loadURI(uri, loadURIOptions);
|
||||
|
||||
await BrowserTestUtils.browserStopped(gBrowser);
|
||||
|
||||
// Some of the documents we're using in this test use Fluent,
|
||||
// and they may finish localization later.
|
||||
// To prevent this test from being intermittent, we'll
|
||||
// wait for the `document.l10n.ready` promise to resolve.
|
||||
if (gBrowser.selectedBrowser.contentWindow &&
|
||||
gBrowser.selectedBrowser.contentWindow.document.l10n) {
|
||||
await gBrowser.selectedBrowser.contentWindow.document.l10n.ready;
|
||||
}
|
||||
gExpectedHistory.index++;
|
||||
gExpectedHistory.entries.push({
|
||||
uri: gBrowser.currentURI.spec,
|
||||
|
@ -79,6 +79,11 @@ function testOnWindow(aTestData) {
|
||||
await BrowserTestUtils.waitForContentEvent(browser, "DOMContentLoaded");
|
||||
|
||||
let doc = win.gBrowser.contentDocument;
|
||||
|
||||
// This test works on a document which uses Fluent.
|
||||
// Fluent localization may finish later than DOMContentLoaded,
|
||||
// so let's wait for `document.l10n.ready` promise to resolve.
|
||||
await doc.l10n.ready;
|
||||
let advisoryEl = doc.getElementById("advisory_provider");
|
||||
if (aTestData.provider != "google" && aTestData.provider != "google4") {
|
||||
ok(!advisoryEl, "Advisory should not be shown");
|
||||
|
Loading…
Reference in New Issue
Block a user