Backed out changesets 674c36d744fb (bug 1000114) and eddce10b8511 (bug 1004506) for frequent OSX 10.8 bc3 failures.
authorRyan VanderMeulen <ryanvm@gmail.com>
Fri, 09 May 2014 16:54:05 -0400
changeset 182414 7586c29906b5ea7276017120d73ecf6daeea820a
parent 182413 739a1d2861aab9a8cfb31ddd7e30b173d0679c6c
child 182415 20ca234fd62b2c00ee67b8eeaf15c7fcfdbef7ae
child 182419 f5a6fab8574f91b768cb343acc92e54909bc6e20
child 182490 11291a7123f4cf39b5cc368131bc481c277ab308
child 182561 881c9397c911ccd28bf0ce65428b2d929d7a41b9
push id26761
push userryanvm@gmail.com
push dateFri, 09 May 2014 20:53:51 +0000
treeherdermozilla-central@7586c29906b5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1000114, 1004506
milestone32.0a1
backs out674c36d744fbb637c41fc246ab9416fb1244460e
first release with
nightly linux32
7586c29906b5 / 32.0a1 / 20140510030204 / files
nightly linux64
7586c29906b5 / 32.0a1 / 20140510030204 / files
nightly mac
7586c29906b5 / 32.0a1 / 20140510030204 / files
nightly win32
7586c29906b5 / 32.0a1 / 20140510030204 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Backed out changesets 674c36d744fb (bug 1000114) and eddce10b8511 (bug 1004506) for frequent OSX 10.8 bc3 failures.
toolkit/mozapps/extensions/content/extensions.css
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xml
toolkit/mozapps/extensions/test/browser/browser_experiments.js
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -245,13 +245,8 @@ richlistitem:not([selected]) * {
 #detail-view[type="experiment"] #detail-creator {
   display: none;
 }
 
 .view-pane:not([type="experiment"]) .experiment-container,
 .view-pane:not([type="experiment"]) #detail-experiment-container {
   display: none;
 }
-
-.addon[type="experiment"][status="installing"] .experiment-time,
-.addon[type="experiment"][status="installing"] .experiment-state {
-  display: none;
-}
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -2644,23 +2644,16 @@ var gListView = {
     this.removeItem(aInstall, true);
   },
 
   onInstallEnded: function gListView_onInstallEnded(aInstall) {
     // Remove any install entries for upgrades, their status will appear against
     // the existing item
     if (aInstall.existingAddon)
       this.removeItem(aInstall, true);
-
-    if (aInstall.addon.type == "experiment") {
-      let item = this.getListItemForID(aInstall.addon.id);
-      if (item) {
-        item.endDate = getExperimentEndDate(aInstall.addon);
-      }
-    }
   },
 
   addItem: function gListView_addItem(aObj, aIsInstall) {
     if (aObj.type != this._type)
       return;
 
     if (aIsInstall && aObj.existingAddon)
       return;
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -1359,44 +1359,40 @@
 
           let debuggable = this.mAddon.isDebuggable &&
                            Services.prefs.getBoolPref('devtools.chrome.enabled') &&
                            Services.prefs.getBoolPref('devtools.debugger.remote-enabled');
 
           this._debugBtn.disabled = this._debugBtn.hidden = !debuggable
 
           if (this.mAddon.type == "experiment") {
-            this.removeAttribute("notification");
             let prefix = "experiment.";
             let active = this.mAddon.isActive;
 
-            if (!showProgress) {
-              let stateKey = prefix + "state." + (active ? "active" : "complete");
-              this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
+            let stateKey = prefix + "state." + (active ? "active" : "complete");
+            this._experimentState.value = gStrings.ext.GetStringFromName(stateKey);
 
-              let now = Date.now();
-              let end = this.endDate;
-              let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
-
-              let timeKey = prefix + "time.";
-              let timeMessage;
+            let now = Date.now();
+            let end = this.endDate;
+            let days = Math.abs(end - now) / (24 * 60 * 60 * 1000);
 
-              if (days < 1) {
-                timeKey += (active ? "endsToday" : "endedToday");
-                timeMessage = gStrings.ext.GetStringFromName(timeKey);
-              } else {
-                timeKey += (active ? "daysRemaining" : "daysPassed");
-                days = Math.round(days);
-                let timeString = gStrings.ext.GetStringFromName(timeKey);
-                timeMessage = PluralForm.get(days, timeString)
-                                        .replace("#1", days);
-              }
+            let timeKey = prefix + "time.";
+            let timeMessage;
+            if (days < 1) {
+              timeKey += (active ? "endsToday" : "endedToday");
+              timeMessage = gStrings.ext.GetStringFromName(timeKey);
+            } else {
+              timeKey += (active ? "daysRemaining" : "daysPassed");
+              days = Math.round(days);
+              let timeString = gStrings.ext.GetStringFromName(timeKey);
+              timeMessage = PluralForm.get(days, timeString)
+                                      .replace("#1", days);
+            }
 
-              this._experimentTime.value = timeMessage;
-            }
+            this._experimentTime.value = timeMessage;
           }
         ]]></body>
       </method>
 
       <method name="_updateUpgradeInfo">
         <body><![CDATA[
           // Only update the version string if we're displaying the upgrade info
           if (this.hasAttribute("upgrade") && shouldShowVersionNumber(this.mAddon))
--- a/toolkit/mozapps/extensions/test/browser/browser_experiments.js
+++ b/toolkit/mozapps/extensions/test/browser/browser_experiments.js
@@ -6,101 +6,50 @@ let {AddonTestUtils} = Components.utils.
 let {HttpServer} = Components.utils.import("resource://testing-common/httpd.js", {});
 
 let gManagerWindow;
 let gCategoryUtilities;
 let gExperiments;
 let gHttpServer;
 
 let gSavedManifestURI;
-let gIsEnUsLocale;
-
-const SEC_IN_ONE_DAY = 24 * 60 * 60;
-const MS_IN_ONE_DAY  = SEC_IN_ONE_DAY * 1000;
 
 function getExperimentAddons() {
   let deferred = Promise.defer();
   AddonManager.getAddonsByTypes(["experiment"], (addons) => {
     deferred.resolve(addons);
   });
   return deferred.promise;
 }
 
-function getInstallItem() {
-  let doc = gManagerWindow.document;
-  let view = doc.getElementById("view-port").selectedPanel;
-  let list = doc.getElementById("addon-list");
-
-  let node = list.firstChild;
-  while (node) {
-    if (node.getAttribute("status") == "installing") {
-      return node;
-    }
-    node = node.nextSibling;
-  }
-
-  return null;
-}
-
-function patchPolicy(policy, data) {
-  for (let key of Object.keys(data)) {
-    Object.defineProperty(policy, key, {
-      value: data[key],
-      writable: true,
-    });
-  }
-}
-
-function defineNow(policy, time) {
-  patchPolicy(policy, { now: () => new Date(time) });
-}
-
-function openDetailsView(aId) {
-  let item = get_addon_element(gManagerWindow, aId);
-  Assert.ok(item, "Should have got add-on element.");
-  is_element_visible(item, "Add-on element should be visible.");
-
-  EventUtils.synthesizeMouseAtCenter(item, { clickCount: 1 }, gManagerWindow);
-  EventUtils.synthesizeMouseAtCenter(item, { clickCount: 2 }, gManagerWindow);
-
-  let deferred = Promise.defer();
-  wait_for_view_load(gManagerWindow, deferred.resolve);
-  return deferred.promise;
-}
-
 add_task(function* initializeState() {
   gManagerWindow = yield open_manager();
   gCategoryUtilities = new CategoryUtilities(gManagerWindow);
 
   registerCleanupFunction(() => {
     Services.prefs.clearUserPref("experiments.enabled");
     if (gHttpServer) {
       gHttpServer.stop(() => {});
       Services.prefs.clearUserPref("experiments.manifest.cert.checkAttributes");
       if (gSavedManifestURI !== undefined) {
         Services.prefs.setCharPref("experments.manifest.uri", gSavedManifestURI);
       }
     }
     if (gExperiments) {
-      let tmp = {};
-      Cu.import("resource:///modules/experiments/Experiments.jsm", tmp);
-      gExperiments._policy = new tmp.Experiments.Policy();
+      gExperiments._policy.ignoreHashes = false;
     }
   });
 
-  let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry);
-  gIsEnUsLocale = chrome.getSelectedLocale("global") == "en-US";
-
   // The Experiments Manager will interfere with us by preventing installs
   // of experiments it doesn't know about. We remove it from the equation
   // because here we are only concerned with core Addon Manager operation,
   // not the superset Experiments Manager has imposed.
   if ("@mozilla.org/browser/experiments-service;1" in Components.classes) {
     let tmp = {};
-    Cu.import("resource:///modules/experiments/Experiments.jsm", tmp);
+    Components.utils.import("resource:///modules/experiments/Experiments.jsm", tmp);
     // There is a race condition between XPCOM service initialization and
     // this test running. We have to initialize the instance first, then
     // uninitialize it to prevent this.
     gExperiments = tmp.Experiments.instance();
     yield gExperiments._mainTask;
     yield gExperiments.uninit();
   }
 });
@@ -348,237 +297,16 @@ add_task(function testDeactivateExperime
   el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "disable-btn");
   is_element_hidden(el, "Disable button is not visible.");
   el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "enable-btn");
   is_element_hidden(el, "Enable button is not visible.");
   el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "preferences-btn");
   is_element_hidden(el, "Preferences button is not visible.");
 });
 
-add_task(function testActivateRealExperiments() {
-  if (!gExperiments) {
-    info("Skipping experiments test because that feature isn't available.");
-    return;
-  }
-
-  yield gExperiments._updateExperiments({
-    "version": 1,
-    "experiments": [
-      {
-        id: "experiment-2",
-        xpiURL: TESTROOT + "addons/browser_experiment1.xpi",
-        xpiHash: "IRRELEVANT",
-        startTime: Date.now() / 1000 - 3600,
-        endTime: Date.now() / 1000 + 3600,
-        maxActiveSeconds: 600,
-        appName: [Services.appinfo.name],
-        channel: [gExperiments._policy.updatechannel()],
-      },
-    ],
-  });
-  yield gExperiments._run();
-
-  // Check the active experiment.
-
-  let item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org");
-  Assert.ok(item, "Got add-on element.");
-
-  let el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Active");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Less than a day remaining");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container");
-  is_element_hidden(el, "error-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container");
-  is_element_hidden(el, "warning-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container");
-  is_element_hidden(el, "pending-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "version");
-  is_element_hidden(el, "version should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix");
-  is_element_hidden(el, "disabled-postfix should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix");
-  is_element_hidden(el, "update-postfix should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet");
-  is_element_visible(el, "experiment-bullet should be visible.");
-
-  // Check the previous experiment.
-
-  item = get_addon_element(gManagerWindow, "experiment-1");
-  Assert.ok(item, "Got add-on element.");
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Complete");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Less than a day ago");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "error-container");
-  is_element_hidden(el, "error-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "warning-container");
-  is_element_hidden(el, "warning-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "pending-container");
-  is_element_hidden(el, "pending-container should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "version");
-  is_element_hidden(el, "version should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "disabled-postfix");
-  is_element_hidden(el, "disabled-postfix should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "update-postfix");
-  is_element_hidden(el, "update-postfix should be hidden.");
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "class", "experiment-bullet");
-  is_element_visible(el, "experiment-bullet should be visible.");
-
-  // Install an "older" experiment.
-
-  yield gExperiments.disableExperiment("experiment-2");
-
-  let now = Date.now();
-  let fakeNow = now - 5 * MS_IN_ONE_DAY;
-  defineNow(gExperiments._policy, fakeNow);
-
-  yield gExperiments._updateExperiments({
-    "version": 1,
-    "experiments": [
-      {
-        id: "experiment-3",
-        xpiURL: TESTROOT + "addons/browser_experiment1.xpi",
-        xpiHash: "IRRELEVANT",
-        startTime: fakeNow / 1000 - SEC_IN_ONE_DAY,
-        endTime: now / 1000 + 10 * SEC_IN_ONE_DAY,
-        maxActiveSeconds: 100 * SEC_IN_ONE_DAY,
-        appName: [Services.appinfo.name],
-        channel: [gExperiments._policy.updatechannel()],
-      },
-    ],
-  });
-  yield gExperiments._run();
-
-  // Check the active experiment.
-
-  item = get_addon_element(gManagerWindow, "test-experiment1@experiments.mozilla.org");
-  Assert.ok(item, "Got add-on element.");
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Active");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "10 days remaining");
-  }
-
-  // Disable it and check it's previous experiment entry.
-
-  yield gExperiments.disableExperiment("experiment-3");
-
-  item = get_addon_element(gManagerWindow, "experiment-3");
-  Assert.ok(item, "Got add-on element.");
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Complete");
-  }
-
-  el = item.ownerDocument.getAnonymousElementByAttribute(item, "anonid", "experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "5 days ago");
-  }
-});
-
-add_task(function testDetailView() {
-  if (!gExperiments) {
-    info("Skipping experiments test because that feature isn't available.");
-    return;
-  }
-
-  defineNow(gExperiments._policy, Date.now());
-  yield gExperiments._updateExperiments({
-    "version": 1,
-    "experiments": [
-      {
-        id: "experiment-4",
-        xpiURL: TESTROOT + "addons/browser_experiment1.xpi",
-        xpiHash: "IRRELEVANT",
-        startTime: Date.now() / 1000 - 3600,
-        endTime: Date.now() / 1000 + 3600,
-        maxActiveSeconds: 600,
-        appName: [Services.appinfo.name],
-        channel: [gExperiments._policy.updatechannel()],
-      },
-    ],
-  });
-  yield gExperiments._run();
-
-  // Check active experiment.
-
-  yield openDetailsView("test-experiment1@experiments.mozilla.org");
-
-  let el = gManagerWindow.document.getElementById("detail-experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Active");
-  }
-
-  el = gManagerWindow.document.getElementById("detail-experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Less than a day remaining");
-  }
-
-  el = gManagerWindow.document.getElementById("detail-version");
-  is_element_hidden(el, "detail-version should be hidden.");
-  el = gManagerWindow.document.getElementById("detail-creator");
-  is_element_hidden(el, "detail-creator should be hidden.");
-  el = gManagerWindow.document.getElementById("detail-experiment-bullet");
-  is_element_visible(el, "experiment-bullet should be visible.");
-
-  // Check previous experiment.
-
-  yield gCategoryUtilities.openType("experiment");
-  yield openDetailsView("experiment-3");
-
-  let el = gManagerWindow.document.getElementById("detail-experiment-state");
-  is_element_visible(el, "Experiment state label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "Complete");
-  }
-
-  el = gManagerWindow.document.getElementById("detail-experiment-time");
-  is_element_visible(el, "Experiment time label should be visible.");
-  if (gIsEnUsLocale) {
-    Assert.equal(el.value, "5 days ago");
-  }
-
-  el = gManagerWindow.document.getElementById("detail-version");
-  is_element_hidden(el, "detail-version should be hidden.");
-  el = gManagerWindow.document.getElementById("detail-creator");
-  is_element_hidden(el, "detail-creator should be hidden.");
-  el = gManagerWindow.document.getElementById("detail-experiment-bullet");
-  is_element_visible(el, "experiment-bullet should be visible.");
-});
-
 add_task(function* testCleanup() {
   if (gExperiments) {
     Services.prefs.clearUserPref("experiments.enabled");
     Services.prefs.clearUserPref("experiments.manifest.cert.checkAttributes");
     Services.prefs.setCharPref("experiments.manifest.uri", gSavedManifestURI);
 
     // We perform the uninit/init cycle to purge any leftover state.
     yield OS.File.remove(gExperiments._cacheFilePath);