Backed out 4 changesets (bug 1646423, bug 1644544, bug 1646178, bug 1648223) for browser-chrome failures in browser/components/preferences/tests/browser_basic_rebuild_fonts_test.js
authorDorel Luca <dluca@mozilla.com>
Fri, 26 Jun 2020 08:59:45 +0300
changeset 537572 9b981fcfb6ac3119837605e3189c5832446c77ab
parent 537571 5db8f5164ed6731aca5fb2c4adf1c5eb0d7f6fdc
child 537573 9c16ba24eff49a045803849f1cc0cfcb5b7ba133
push id120078
push userdluca@mozilla.com
push dateFri, 26 Jun 2020 06:00:49 +0000
treeherderautoland@9b981fcfb6ac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1646423, 1644544, 1646178, 1648223
milestone79.0a1
backs out48790fe7990a69934299ad1f7618c3093ace2176
2d52e80dd32125ae5206287205c3b50aa305fce3
5186e66006a4f5efd568e92ccaf94512def374ca
28d0dc323af8d43abbdd3c3020dcdaa5e424fa35
first release with
nightly linux32
9b981fcfb6ac / 79.0a1 / 20200626094540 / files
nightly linux64
9b981fcfb6ac / 79.0a1 / 20200626094540 / files
nightly mac
9b981fcfb6ac / 79.0a1 / 20200626094540 / files
nightly win32
9b981fcfb6ac / 79.0a1 / 20200626094540 / files
nightly win64
9b981fcfb6ac / 79.0a1 / 20200626094540 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out 4 changesets (bug 1646423, bug 1644544, bug 1646178, bug 1648223) for browser-chrome failures in browser/components/preferences/tests/browser_basic_rebuild_fonts_test.js Backed out changeset 48790fe7990a (bug 1648223) Backed out changeset 2d52e80dd321 (bug 1646178) Backed out changeset 5186e66006a4 (bug 1646423) Backed out changeset 28d0dc323af8 (bug 1644544)
browser/app/profile/firefox.js
browser/components/BrowserGlue.jsm
browser/components/preferences/experimental.inc.xhtml
browser/components/preferences/experimental.js
browser/components/preferences/tests/browser.ini
browser/components/preferences/tests/browser_experimental_features.js
browser/components/preferences/tests/browser_experimental_features_hidden_when_not_public.js
browser/locales/en-US/browser/preferences/preferences.ftl
browser/themes/shared/preferences/preferences.inc.css
toolkit/components/featuregates/FeatureGate.jsm
toolkit/components/featuregates/docs/index.rst
toolkit/components/telemetry/docs/data/crash-ping.rst
toolkit/crashreporter/CrashAnnotations.yaml
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -749,21 +749,17 @@ pref("plugins.favorfallback.rules", "nos
 #ifdef XP_WIN
   pref("browser.preferences.instantApply", false);
 #else
   pref("browser.preferences.instantApply", true);
 #endif
 
 // Toggling Search bar on and off in about:preferences
 pref("browser.preferences.search", true);
-#if defined(NIGHTLY_BUILD)
-pref("browser.preferences.experimental", true);
-#else
 pref("browser.preferences.experimental", false);
-#endif
 pref("browser.preferences.defaultPerformanceSettings.enabled", true);
 
 pref("browser.download.show_plugins_in_list", true);
 pref("browser.download.hide_plugins_without_extensions", true);
 
 // Backspace and Shift+Backspace behavior
 // 0 goes Back/Forward
 // 1 act like PgUp/PgDown
--- a/browser/components/BrowserGlue.jsm
+++ b/browser/components/BrowserGlue.jsm
@@ -50,22 +50,16 @@ ChromeUtils.defineModuleGetter(
 );
 
 ChromeUtils.defineModuleGetter(
   this,
   "DeferredTask",
   "resource://gre/modules/DeferredTask.jsm"
 );
 
-ChromeUtils.defineModuleGetter(
-  this,
-  "FeatureGate",
-  "resource://featuregates/FeatureGate.jsm"
-);
-
 XPCOMUtils.defineLazyServiceGetter(
   this,
   "PushService",
   "@mozilla.org/push/Service;1",
   "nsIPushService"
 );
 
 const PREF_PDFJS_ISDEFAULT_CACHE_STATE = "pdfjs.enabledCache.state";
@@ -2172,18 +2166,16 @@ BrowserGlue.prototype = {
           }
         }
       });
     }
 
     if (AppConstants.MOZ_CRASHREPORTER) {
       UnsubmittedCrashHandler.init();
       UnsubmittedCrashHandler.scheduleCheckForUnsubmittedCrashReports();
-      FeatureGate.annotateCrashReporter();
-      FeatureGate.observePrefChangesForCrashReportAnnotation();
     }
 
     if (AppConstants.ASAN_REPORTER) {
       var { AsanReporter } = ChromeUtils.import(
         "resource:///modules/AsanReporter.jsm"
       );
       AsanReporter.init();
     }
--- a/browser/components/preferences/experimental.inc.xhtml
+++ b/browser/components/preferences/experimental.inc.xhtml
@@ -1,32 +1,28 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 <!-- Experimental panel -->
 
 <script src="chrome://browser/content/preferences/experimental.js"/>
 <html:template id="template-paneExperimental">
-<vbox id="firefoxExperimentalCategory"
-      class="subcategory"
-      hidden="true"
-      data-category="paneExperimental">
-  <html:h1 style="-moz-box-flex: 1;" data-l10n-id="pane-experimental-title"/>
-  <label><html:h2 id="pane-experimental-subtitle" data-l10n-id="pane-experimental-subtitle"/></label>
-</vbox>
-
-<groupbox data-category="paneExperimental"
-          id="pane-experimental-featureGates"
-          hidden="true">
-  <label class="search-header" hidden="true">
-    <html:h2 id="pane-experimental-search-results-header" data-l10n-id="pane-experimental-search-results-header"/>
-  </label>
+<html:div id="firefoxExperimentalCategory"
+          class="subcategory"
+          hidden="true"
+          data-category="paneExperimental">
+  <html:h1 style="-moz-box-flex: 1;"
+           data-l10n-id="pane-experimental-title"/>
+  <html:h2 id="pane-experimental-subtitle"
+           data-l10n-id="pane-experimental-subtitle"/>
   <html:p data-l10n-id="pane-experimental-description"/>
-</groupbox>
+</html:div>
+<html:div id="pane-experimental-featureGates"
+          data-category="paneExperimental"/>
 </html:template>
 
 <html:template id="template-featureGate">
     <html:div class="featureGate">
         <checkbox class="featureGateCheckbox"/>
         <label class="featureGateDescription"/>
     </html:div>
 </html:template>
--- a/browser/components/preferences/experimental.js
+++ b/browser/components/preferences/experimental.js
@@ -58,24 +58,19 @@ var gExperimentalPane = {
     }
     this.inited = true;
     window.addEventListener("unload", () => this.removePrefObservers());
     this._template = document.getElementById("template-featureGate");
     this._featureGatesContainer = document.getElementById(
       "pane-experimental-featureGates"
     );
     this._boundRestartObserver = this._observeRestart.bind(this);
-    let searchParams = new URLSearchParams(document.documentURIObject.query);
-    let definitionsUrl = searchParams.get("definitionsUrl");
-    let features = await FeatureGate.all(definitionsUrl);
+    let features = await FeatureGate.all();
     let frag = document.createDocumentFragment();
     for (let feature of features) {
-      if (!feature.isPublic) {
-        continue;
-      }
       if (Preferences.get(feature.preference)) {
         console.error(
           "Preference control already exists for experimental feature '" +
             feature.id +
             "' with preference '" +
             feature.preference +
             "'"
         );
--- a/browser/components/preferences/tests/browser.ini
+++ b/browser/components/preferences/tests/browser.ini
@@ -13,17 +13,16 @@ support-files =
 [browser_applications_selection.js]
 [browser_advanced_update.js]
 skip-if = !updater
 [browser_basic_rebuild_fonts_test.js]
 [browser_bug410900.js]
 [browser_bug731866.js]
 [browser_bug1579418.js]
 [browser_experimental_features.js]
-[browser_experimental_features_hidden_when_not_public.js]
 [browser_filetype_dialog.js]
 [browser_search_no_results_change_category.js]
 [browser_search_within_preferences_1.js]
 skip-if = (os == 'win' && (processor == "x86_64" || processor == "aarch64")) # Bug 1480314, aarch64 due to 1536560
 [browser_search_within_preferences_2.js]
 [browser_search_within_preferences_command.js]
 [browser_search_subdialogs_within_preferences_1.js]
 [browser_search_subdialogs_within_preferences_2.js]
--- a/browser/components/preferences/tests/browser_experimental_features.js
+++ b/browser/components/preferences/tests/browser_experimental_features.js
@@ -25,17 +25,18 @@ add_task(async function testCanOpenWithP
 
   await openPreferencesViaOpenPreferencesAPI("paneHome", { leaveOpen: true });
   let doc = gBrowser.contentDocument;
 
   let experimentalCategory = doc.getElementById("category-experimental");
   ok(experimentalCategory, "The category exists");
   ok(!experimentalCategory.hidden, "The category is not hidden");
 
-  let categoryHeader = await TestUtils.waitForCondition(
+  let categoryHeader;
+  categoryHeader = await TestUtils.waitForCondition(
     () => doc.getElementById("firefoxExperimentalCategory"),
     "Waiting for experimental features category to get initialized"
   );
   ok(
     categoryHeader.hidden,
     "The category header should be hidden when Home is selected"
   );
 
deleted file mode 100644
--- a/browser/components/preferences/tests/browser_experimental_features_hidden_when_not_public.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-ChromeUtils.import("resource://gre/modules/Services.jsm", this);
-ChromeUtils.import("resource://featuregates/FeatureGate.jsm", this);
-ChromeUtils.import(
-  "resource://featuregates/FeatureGateImplementation.jsm",
-  this
-);
-ChromeUtils.import("resource://testing-common/httpd.js", this);
-
-class DefinitionServer {
-  constructor(definitionOverrides = []) {
-    this.server = new HttpServer();
-    this.server.registerPathHandler("/definitions.json", this);
-    this.definitions = {};
-
-    for (const override of definitionOverrides) {
-      this.addDefinition(override);
-    }
-
-    this.server.start();
-    registerCleanupFunction(
-      () => new Promise(resolve => this.server.stop(resolve))
-    );
-  }
-
-  // for nsIHttpRequestHandler
-  handle(request, response) {
-    response.write(JSON.stringify(this.definitions));
-  }
-
-  get definitionsUrl() {
-    const { primaryScheme, primaryHost, primaryPort } = this.server.identity;
-    return `${primaryScheme}://${primaryHost}:${primaryPort}/definitions.json`;
-  }
-
-  addDefinition(overrides = {}) {
-    const definition = {
-      id: "test-feature",
-      // These l10n IDs are just random so we have some text to display
-      title: "pane-experimental-subtitle",
-      description: "pane-experimental-description",
-      restartRequired: false,
-      type: "boolean",
-      preference: "test.feature",
-      defaultValue: false,
-      isPublic: false,
-      ...overrides,
-    };
-    // convert targeted values, used by fromId
-    definition.isPublic = { default: definition.isPublic };
-    definition.defaultValue = { default: definition.defaultValue };
-    this.definitions[definition.id] = definition;
-    return definition;
-  }
-}
-
-add_task(async function testNonPublicFeaturesShouldntGetDisplayed() {
-  await SpecialPowers.pushPrefEnv({
-    set: [["browser.preferences.experimental", true]],
-  });
-
-  const server = new DefinitionServer();
-  let definitions = [
-    { id: "test-featureA", isPublic: true, preference: "test.feature.a" },
-    { id: "test-featureB", isPublic: false, preference: "test.feature.b" },
-    { id: "test-featureC", isPublic: true, preference: "test.feature.c" },
-  ];
-  for (let { id, isPublic, preference } of definitions) {
-    server.addDefinition({ id, isPublic, preference });
-  }
-  await BrowserTestUtils.openNewForegroundTab(
-    gBrowser,
-    `about:preferences?definitionsUrl=${encodeURIComponent(
-      server.definitionsUrl
-    )}#paneExperimental`
-  );
-  let doc = gBrowser.contentDocument;
-
-  await TestUtils.waitForCondition(
-    () => doc.getElementById(definitions.find(d => d.isPublic).id),
-    "wait for the first public feature to get added to the DOM"
-  );
-
-  for (let definition of definitions) {
-    is(
-      !!doc.getElementById(definition.id),
-      definition.isPublic,
-      "feature should only be in DOM if it's public: " + definition.id
-    );
-  }
-
-  BrowserTestUtils.removeTab(gBrowser.selectedTab);
-});
--- a/browser/locales/en-US/browser/preferences/preferences.ftl
+++ b/browser/locales/en-US/browser/preferences/preferences.ftl
@@ -52,17 +52,16 @@ category-privacy =
 pane-sync-title2 = { -sync-brand-short-name }
 category-sync2 =
     .tooltiptext = { pane-sync-title2 }
 
 pane-experimental-title = { -brand-short-name } Experiments
 category-experimental =
     .tooltiptext = { -brand-short-name } Experiments
 pane-experimental-subtitle = Proceed with Caution
-pane-experimental-search-results-header = { -brand-short-name } Experiments: Proceed with Caution
 pane-experimental-description = Changing advanced configuration preferences can impact { -brand-short-name } performance or security.
 
 help-button-label = { -brand-short-name } Support
 addons-button-label = Extensions & Themes
 
 focus-search =
     .key = f
 
--- a/browser/themes/shared/preferences/preferences.inc.css
+++ b/browser/themes/shared/preferences/preferences.inc.css
@@ -1104,17 +1104,16 @@ richlistitem .text-link:hover {
   display: contents;
 }
 
 #proxy-grid > .thin {
   grid-column: span 2;
   height: 20px;
 }
 
-#pane-experimental-search-results-header,
 #pane-experimental-subtitle {
   background-image: url("chrome://global/skin/icons/warning.svg");
   background-repeat: no-repeat;
   background-position: 0 center;
   background-size: contain;
   min-height: 30px;
   padding-inline-start: 38px;
   display: flex;
--- a/toolkit/components/featuregates/FeatureGate.jsm
+++ b/toolkit/components/featuregates/FeatureGate.jsm
@@ -26,22 +26,17 @@ XPCOMUtils.defineLazyGetter(this, "gFeat
   const url = "resource://featuregates/feature_definitions.json";
   return fetchFeatureDefinitions(url);
 });
 
 const kTargetFacts = new Map([
   ["release", AppConstants.MOZ_UPDATE_CHANNEL === "release"],
   ["beta", AppConstants.MOZ_UPDATE_CHANNEL === "beta"],
   ["dev-edition", AppConstants.MOZ_UPDATE_CHANNEL === "aurora"],
-  [
-    "nightly",
-    AppConstants.MOZ_UPDATE_CHANNEL === "nightly" ||
-      /* Treat local builds the same as Nightly builds */
-      AppConstants.MOZ_UPDATE_CHANNEL === "default",
-  ],
+  ["nightly", AppConstants.MOZ_UPDATE_CHANNEL === "nightly"],
   ["win", AppConstants.platform === "win"],
   ["mac", AppConstants.platform === "macosx"],
   ["linux", AppConstants.platform === "linux"],
   ["android", AppConstants.platform === "android"],
 ]);
 
 async function fetchFeatureDefinitions(url) {
   const res = await fetch(url);
@@ -84,25 +79,16 @@ function evaluateTargetedValue(targetedV
 function buildFeatureGateImplementation(definition) {
   const targetValueKeys = ["defaultValue", "isPublic"];
   for (const key of targetValueKeys) {
     definition[key] = evaluateTargetedValue(definition[key], kTargetFacts);
   }
   return new FeatureGateImplementation(definition);
 }
 
-let featureGatePrefObserver = {
-  onChange() {
-    FeatureGate.annotateCrashReporter();
-  },
-  // Ignore onEnable and onDisable since onChange is called in both cases.
-  onEnable() {},
-  onDisable() {},
-};
-
 const kFeatureGateCache = new Map();
 
 /** A high level control for turning features on and off. */
 class FeatureGate {
   /*
    * This is structured as a class with static methods to that sphinx-js can
    * easily document it. This constructor is required for sphinx-js to detect
    * this class for documentation.
@@ -153,45 +139,16 @@ class FeatureGate {
       // Make a copy of the definition, since we are about to modify it
       definitions[definitions.length] = buildFeatureGateImplementation(
         Object.assign({}, definition)
       );
     }
     return definitions;
   }
 
-  static async observePrefChangesForCrashReportAnnotation(
-    testDefinitionsUrl = undefined
-  ) {
-    let featureDefinitions = await FeatureGate.all(testDefinitionsUrl);
-
-    for (let definition of featureDefinitions.values()) {
-      FeatureGate.addObserver(
-        definition.id,
-        featureGatePrefObserver,
-        testDefinitionsUrl
-      );
-    }
-  }
-
-  static async annotateCrashReporter() {
-    let crashReporter = Cc["@mozilla.org/toolkit/crash-reporter;1"].getService(
-      Ci.nsICrashReporter
-    );
-    if (!crashReporter?.enabled) {
-      return;
-    }
-    let features = await FeatureGate.all();
-    let enabledFeatures = features
-      .filter(async f => f.getValue())
-      .map(f => f.preference)
-      .join(",");
-    crashReporter.annotateCrashReport("ExperimentalFeatures", enabledFeatures);
-  }
-
   /**
    * Add an observer for a feature gate by ID. If the feature is of type
    * boolean and currently enabled, `onEnable` will be called.
    *
    * The underlying feature gate instance will be shared with all other callers
    * of this function, and share an observer.
    *
    * @param {string} id The ID of the feature's definition in `Features.toml`.
--- a/toolkit/components/featuregates/docs/index.rst
+++ b/toolkit/components/featuregates/docs/index.rst
@@ -10,35 +10,31 @@ pitfalls of other systems, such as using
 to be compatible with tools that want to know and affect the state of
 features in Firefox over time and in the wild.
 
 Feature Definitions
 ===================
 
 All features must have a definition, specified in
 ``toolkit/components/featuregates/Features.toml``. These definitions include
-data such as references to title and description strings (to be shown to users),
-and bug numbers (to track the development of the feature over time). Here is an
-example feature definition with an id of ``demo-feature``:
+data such as title and description (to be shown to users), and bug numbers (to
+track the development of the feature over time). Here is an example feature
+definition with an id of ``demo-feature``:
 
 .. code-block:: toml
 
    [demo-feature]
-   title = "experimental-features-demo-feature"
-   description = "experimental-features-demo-feature-description"
+   title = "Demo Feature"
+   description = "A no-op feature to demo the feature gate system."
    restart-required = false
    bug-numbers = [1479127]
    type = boolean
    is-public = {default = false, nightly = true}
    default-value = {default = false, nightly = true}
 
-The references defined in the `title` and `description` values point to strings
-stored in ``toolkit/locales/en-US/toolkit/featuregates/features.ftl``. The `title`
-string should specify the user-facing string as the `label` attribute.
-
 .. _targeted value:
 
 Targeted values
 ---------------
 
 Several fields can take a value that indicates it varies by channel and OS.
 These are known as *targeted values*. The simplest computed value is to
 simply provide the value:
@@ -82,50 +78,27 @@ more-specific case matches. The conditio
 * ``mac``
 * ``linux``
 * ``android``
 
 Fields
 ------
 
 title
-    Required. The string ID of the human readable name for the feature, meant to be shown to
-    users. Should fit onto a single line. The actual string should be defined in
-    ``toolkit/locales/en-US/toolkit/featuregates/features.ftl`` with the user-facing value
-    defined as the `label` attribute of the string.
+    Required. A human readable name for the feature, meant to be shown to
+    users. Should fit onto a single line.
 
 description
-    Required. The string ID of the human readable description for the feature, meant to be shown to
-    users. Should be at most a paragraph. The actual string should be defined in
-    ``toolkit/locales/en-US/toolkit/featuregates/features.ftl``.
+    Required. A human readable description for the feature, meant to be shown to
+    users. Should be at most a paragraph.
 
 description-links
     Optional. A dictionary of key-value pairs that are referenced in the description. The key
     name must appear in the description localization text as
-    <a data-l10n-name="key-name">. For example in Features.toml:
-
-.. code-block:: toml
-
-   [demo-feature]
-   title = "experimental-features-demo-feature"
-   description = "experimental-features-demo-feature-description"
-   description-links = {exampleCom = "https://example.com", exampleOrg = "https://example.org"}
-   restart-required = false
-   bug-numbers = [1479127]
-   type = boolean
-   is-public = {default = false, nightly = true}
-   default-value = {default = false, nightly = true}
-
-and in features.ftl:
-
-.. code-block:: fluent
-
-   experimental-features-demo-feature =
-       .label = Example Demo Feature
-   experimental-features-demo-feature-description = Example demo feature that can point to <a data-l10n-name="exampleCom">.com</a> links and <a data-l10n-name="exampleOrg">.org</a> links.
+    <a data-l10n-name="key-name">.
 
 bug-numbers
     Required. A list of bug numbers related to this feature. This should
     likely be the metabug for the the feature, but any related bugs can be
     included. At least one bug is required.
 
 restart-required
     Required. If this feature requires a the browser to be restarted for changes
--- a/toolkit/components/telemetry/docs/data/crash-ping.rst
+++ b/toolkit/components/telemetry/docs/data/crash-ping.rst
@@ -53,17 +53,16 @@ Structure:
           AvailablePhysicalMemory: <size>, // Windows-only, available physical memory in bytes
           AvailableVirtualMemory: <size>, // Windows-only, available virtual memory in bytes
           BlockedDllList: <list>, // Windows-only, see WindowsDllBlocklist.cpp for details
           BlocklistInitFailed: "1", // Windows-only, present only if the DLL blocklist initialization failed
           CrashTime: <time>, // Seconds since the Epoch
           ContainsMemoryReport: "1", // Optional, if set indicates that the crash had a memory report attached
           DOMFissionEnabled: "1", // Optional, if set indicates that a Fission window had been opened
           EventLoopNestingLevel: <levels>, // Optional, present only if >0, indicates the nesting level of the event-loop
-          ExperimentalFeatures: <features>, // Optional, a comma-separated string that specifies the enabled experimental features from about:preferences#experimental
           ipc_channel_error: <error string>, // Optional, contains the string processing error reason for an ipc-based content crash
           IsGarbageCollecting: "1", // Optional, if set indicates that the crash occurred while the garbage collector was running
           LowCommitSpaceEvents: <num>, // Windows-only, present only if >0, number of low commit space events detected by the available memory tracker
           MemoryErrorCorrection: <type>, // Windows-only, indicates the type of ECC memory in use, see below
           MozCrashReason: <reason>, // Optional, contains the string passed to MOZ_CRASH()
           OOMAllocationSize: <size>, // Size of the allocation that caused an OOM
           RemoteType: <type>, // Optional, type of content process, see below for a list of types
           SecondsSinceLastCrash: <duration>, // Seconds elapsed since the last crash occurred
--- a/toolkit/crashreporter/CrashAnnotations.yaml
+++ b/toolkit/crashreporter/CrashAnnotations.yaml
@@ -313,22 +313,16 @@ EventLoopNestingLevel:
   type: integer
   ping: true
 
 ExpectedStreamLen:
   description: >
     Expected length of an IPC proxy stream.
   type: integer
 
-ExperimentalFeatures:
-  description: >
-    Comma-separated list of enabled experimental features from about:preferences#experimental.
-  type: string
-  ping: true
-
 FlashProcessDump:
   description: >
     Type of process the flash plugin is running in, can be either "Broker" or
     "Sandbox".
   type: string
 
 FramePoisonBase:
   description: >