Bug 1453480 - Update Preferences to use fluent-dom 0.2.0 API. r?stas draft
authorZibi Braniecki <zbraniecki@mozilla.com>
Thu, 12 Apr 2018 22:45:02 -0700
changeset 781748 8680348e0a2b7f1e5642fe1d6d51e504f8213ab6
parent 781747 b5e84af304bed1b33b2752a2e481a590ea607a81
child 781749 1136ecfdd9195da239b44e80e362fa31353036f5
push id106408
push userbmo:gandalf@aviary.pl
push dateFri, 13 Apr 2018 15:38:34 +0000
reviewersstas
bugs1453480
milestone61.0a1
Bug 1453480 - Update Preferences to use fluent-dom 0.2.0 API. r?stas MozReview-Commit-ID: 4CFnjf9VFLz
browser/components/preferences/in-content/findInPage.js
browser/components/preferences/in-content/tests/browser_fluent.js
--- a/browser/components/preferences/in-content/findInPage.js
+++ b/browser/components/preferences/in-content/findInPage.js
@@ -478,17 +478,17 @@ var gSearchResultsPane = {
       // building a string of concatenated translated strings out of it.
       let keywords = messages.map((msg, i) => {
         let [refId, refAttr] = refs[i];
         if (!msg) {
           console.error(`Missing search l10n id "${refId}"`);
           return null;
         }
         if (refAttr) {
-          let attr = msg.attrs.find(a => a.name === refAttr);
+          let attr = msg.attributes && msg.attributes.find(a => a.name === refAttr);
           if (!attr) {
             console.error(`Missing search l10n id "${refId}.${refAttr}"`);
             return null;
           }
           if (attr.value === "") {
             console.error(`Empty value added to search-l10n-ids "${refId}.${refAttr}"`);
           }
           return attr.value;
--- a/browser/components/preferences/in-content/tests/browser_fluent.js
+++ b/browser/components/preferences/in-content/tests/browser_fluent.js
@@ -34,15 +34,15 @@ add_task(async function() {
     ["performance-default-content-process-count", { num: defaultProcessCount }]
   ]);
 
   let elem = doc.querySelector(
     `#contentProcessCount > menupopup > menuitem[value="${defaultProcessCount}"]`);
 
   Assert.deepEqual(msg, {
     value: null,
-    attrs: [
+    attributes: [
       {name: "label", value: elem.getAttribute("label")}
     ]
   });
 
   BrowserTestUtils.removeTab(gBrowser.selectedTab);
 });