Bug 1613645 - wait for translation before checking strings in urlbar interventions tests. r=adw
authorMarco Bonardo <mbonardo@mozilla.com>
Fri, 07 Feb 2020 10:46:25 +0000
changeset 512871 66d4df827facee14fd30b278ba5d9bb915530474
parent 512870 31866fa626247e5cd5552bdaa8a717b5c83d5ffd
child 512872 1f59ad1b9d220feb6d17c5cc38111c0ff235a870
push id37100
push userapavel@mozilla.com
push dateFri, 07 Feb 2020 21:53:54 +0000
treeherdermozilla-central@882200a11bcf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersadw
bugs1613645
milestone74.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1613645 - wait for translation before checking strings in urlbar interventions tests. r=adw Differential Revision: https://phabricator.services.mozilla.com/D61831
browser/components/urlbar/tests/browser/head.js
browser/components/urlbar/tests/browser/interventions_update/head.js
--- a/browser/components/urlbar/tests/browser/head.js
+++ b/browser/components/urlbar/tests/browser/head.js
@@ -98,16 +98,17 @@ async function checkIntervention({
   tip,
   title,
   button,
   awaitCallback,
 } = {}) {
   // Do a search that triggers the tip.
   let [result, element] = await awaitTip(searchString);
   Assert.strictEqual(result.payload.type, tip);
+  await element.ownerDocument.l10n.translateFragment(element);
 
   let actualTitle = element._elements.get("title").textContent;
   if (typeof title == "string") {
     Assert.equal(actualTitle, title, "Title string");
   } else {
     // regexp
     Assert.ok(title.test(actualTitle), "Title regexp");
   }
--- a/browser/components/urlbar/tests/browser/interventions_update/head.js
+++ b/browser/components/urlbar/tests/browser/interventions_update/head.js
@@ -225,18 +225,18 @@ async function doUpdateTest({
   searchString,
   tip,
   title,
   button,
   awaitCallback,
 } = {}) {
   // Do a search that triggers the tip.
   let [result, element] = await awaitTip(searchString);
-
   Assert.strictEqual(result.payload.type, tip, "Tip type");
+  await element.ownerDocument.l10n.translateFragment(element);
 
   let actualTitle = element._elements.get("title").textContent;
   if (typeof title == "string") {
     Assert.equal(actualTitle, title, "Title string");
   } else {
     // regexp
     Assert.ok(title.test(actualTitle), "Title regexp");
   }