Bug 1373650. Disable Report Site Issue page action before running page action tests. r=adw draft
authorMike Taylor <miket@mozilla.com>
Wed, 09 Aug 2017 14:53:53 -0400
changeset 645007 89c2328491ff
parent 645006 391768c83b7b
child 725783 0e05be2e92a5
push id73626
push userbmo:miket@mozilla.com
push dateFri, 11 Aug 2017 18:27:24 +0000
reviewersadw
bugs1373650
milestone57.0a1
Bug 1373650. Disable Report Site Issue page action before running page action tests. r=adw MozReview-Commit-ID: J5gAWBvw8td
browser/modules/test/browser/browser_PageActions.js
browser/modules/test/browser/head.js
--- a/browser/modules/test/browser/browser_PageActions.js
+++ b/browser/modules/test/browser/browser_PageActions.js
@@ -9,16 +9,18 @@
 add_task(async function init() {
   // The page action urlbar button, and therefore the panel, is only shown when
   // the current tab is actionable -- i.e., a normal web page.  about:blank is
   // not, so open a new tab first thing, and close it when this test is done.
   let tab = await BrowserTestUtils.openNewForegroundTab({
     gBrowser,
     url: "http://example.com/",
   });
+
+  await disableNonReleaseActions();
   registerCleanupFunction(async () => {
     await BrowserTestUtils.removeTab(tab);
   });
 });
 
 
 // Tests a simple non-built-in action without an iframe or subview.  Also
 // thoroughly checks most of the action's properties, methods, and DOM nodes, so
--- a/browser/modules/test/browser/head.js
+++ b/browser/modules/test/browser/head.js
@@ -223,8 +223,19 @@ function getPopupNotificationNode() {
   // clear, popupNotifications is a list of <xul:popupnotification>
   // nodes.
   let popupNotifications = PopupNotifications.panel.childNodes;
   Assert.equal(popupNotifications.length, 1,
                "Should be showing a <xul:popupnotification>");
   return popupNotifications[0];
 }
 
+
+/**
+ * Disable non-release page actions (that are tested elsewhere).
+ *
+ * @return void
+ */
+async function disableNonReleaseActions() {
+  if (AppConstants.MOZ_DEV_EDITION || AppConstants.NIGHTLY_BUILD) {
+    await SpecialPowers.pushPrefEnv({set: [["extensions.webcompat-reporter.enabled", false]]});
+  }
+}