Bug 1551490 - Fix browser_webext_icon.js when HTML about:addons is enabled by default. r=rpl, a=test-only
authorRob Wu <rob@robwu.nl>
Fri, 07 Jun 2019 18:33:52 +0000
changeset 533836 33f0e94f70414d47ba1f8c0a032fd5d4f20580a0
parent 533835 9dbc53624d7c680cfa9c7d295b225e500dba0288
child 533837 3bbbdeca9f13b3c20c6df3419c1726de429fb9e8
push id11438
push userjcristau@mozilla.com
push dateWed, 12 Jun 2019 17:34:20 +0000
treeherdermozilla-beta@a2fc7a9510bd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrpl, test-only
bugs1551490
milestone68.0
Bug 1551490 - Fix browser_webext_icon.js when HTML about:addons is enabled by default. r=rpl, a=test-only Differential Revision: https://phabricator.services.mozilla.com/D34183
toolkit/mozapps/extensions/test/browser/browser_webext_icon.js
--- a/toolkit/mozapps/extensions/test/browser/browser_webext_icon.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_webext_icon.js
@@ -50,20 +50,42 @@ add_task(async function test_addon_icon(
       icons,
     },
     files,
   };
 
   const extension = ExtensionTestUtils.loadExtension(extensionDefinition);
   await extension.startup();
 
+  info(`Testing XUL about:addons`);
+  await SpecialPowers.pushPrefEnv({
+    set: [["extensions.htmlaboutaddons.enabled", false]],
+  });
+
   await checkIconInView("addons://list/extension", "list", doc => {
     const addon = get_addon_element(doc.defaultView, id);
     const content = doc.getAnonymousElementByAttribute(addon, "class", "content-container");
     return content.querySelector(".icon");
   });
 
   await checkIconInView("addons://detail/" + encodeURIComponent(id), "details", doc => {
     return doc.getElementById("detail-icon");
   });
 
+  await SpecialPowers.popPrefEnv();
+
+  info(`Testing HTML about:addons`);
+  await SpecialPowers.pushPrefEnv({
+    set: [["extensions.htmlaboutaddons.enabled", true]],
+  });
+
+  await checkIconInView("addons://list/extension", "list", doc => {
+    return get_addon_element(doc.defaultView, id).querySelector(".addon-icon");
+  });
+
+  await checkIconInView("addons://detail/" + encodeURIComponent(id), "details", doc => {
+    return get_addon_element(doc.defaultView, id).querySelector(".addon-icon");
+  });
+
+  await SpecialPowers.popPrefEnv();
+
   await extension.unload();
 });