Backed out changeset 2b0640fa5b18 (bug 837326) for Windows build failures on a CLOSED TREE
authorEd Morley <emorley@mozilla.com>
Fri, 21 Jun 2013 18:21:33 +0100
changeset 147482 74d3dd56cee0f8518169c57962bc6491e06a1d2f
parent 147481 429090f9109a14ff98454e1560605c2b2ea0511d
child 147483 68e5d9fe91fc7f0ecdbbab0432f5735d7e4bc141
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs837326
milestone24.0a1
backs out2b0640fa5b18f355bcf475b76043ee0342bc6c33
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 2b0640fa5b18 (bug 837326) for Windows build failures on a CLOSED TREE
toolkit/components/telemetry/tests/unit/head.js
toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
toolkit/components/telemetry/tests/unit/test_ThirdPartyCookieProbe.js
toolkit/components/telemetry/tests/unit/xpcshell.ini
deleted file mode 100644
--- a/toolkit/components/telemetry/tests/unit/head.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-
-// copied from toolkit/mozapps/extensions/test/xpcshell/head_addons.js
-const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
-const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
-
-function createAppInfo(id, name, version, platformVersion) {
-  gAppInfo = {
-    // nsIXULAppInfo
-    vendor: "Mozilla",
-    name: name,
-    ID: id,
-    version: version,
-    appBuildID: "2007010101",
-    platformVersion: platformVersion,
-    platformBuildID: "2007010101",
-
-    // nsIXULRuntime
-    inSafeMode: false,
-    logConsoleErrors: true,
-    OS: "XPCShell",
-    XPCOMABI: "noarch-spidermonkey",
-    invalidateCachesOnRestart: function invalidateCachesOnRestart() {
-      // Do nothing
-    },
-
-    // nsICrashReporter
-    annotations: {},
-
-    annotateCrashReport: function(key, data) {
-      this.annotations[key] = data;
-    },
-
-    QueryInterface: XPCOMUtils.generateQI([Ci.nsIXULAppInfo,
-                                           Ci.nsIXULRuntime,
-                                           Ci.nsICrashReporter,
-                                           Ci.nsISupports])
-  };
-
-  var XULAppInfoFactory = {
-    createInstance: function (outer, iid) {
-      if (outer != null)
-        throw Components.results.NS_ERROR_NO_AGGREGATION;
-      return gAppInfo.QueryInterface(iid);
-    }
-  };
-  var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-  registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
-                            XULAPPINFO_CONTRACTID, XULAppInfoFactory);
-}
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetryPing.js
@@ -352,16 +352,65 @@ function runOldPingFileTest() {
   do_check_true(histogramsFile.exists());
 
   let mtime = histogramsFile.lastModifiedTime;
   histogramsFile.lastModifiedTime = mtime - 8 * 24 * 60 * 60 * 1000; // 8 days.
   TelemetryPing.testLoadHistograms(histogramsFile, true);
   do_check_false(histogramsFile.exists());
 }
 
+// copied from toolkit/mozapps/extensions/test/xpcshell/head_addons.js
+const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
+const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
+
+function createAppInfo(id, name, version, platformVersion) {
+  gAppInfo = {
+    // nsIXULAppInfo
+    vendor: "Mozilla",
+    name: name,
+    ID: id,
+    version: version,
+    appBuildID: "2007010101",
+    platformVersion: platformVersion,
+    platformBuildID: "2007010101",
+
+    // nsIXULRuntime
+    inSafeMode: false,
+    logConsoleErrors: true,
+    OS: "XPCShell",
+    XPCOMABI: "noarch-spidermonkey",
+    invalidateCachesOnRestart: function invalidateCachesOnRestart() {
+      // Do nothing
+    },
+
+    // nsICrashReporter
+    annotations: {},
+
+    annotateCrashReport: function(key, data) {
+      this.annotations[key] = data;
+    },
+
+    QueryInterface: XPCOMUtils.generateQI([Ci.nsIXULAppInfo,
+                                           Ci.nsIXULRuntime,
+                                           Ci.nsICrashReporter,
+                                           Ci.nsISupports])
+  };
+
+  var XULAppInfoFactory = {
+    createInstance: function (outer, iid) {
+      if (outer != null)
+        throw Components.results.NS_ERROR_NO_AGGREGATION;
+      return gAppInfo.QueryInterface(iid);
+    }
+  };
+  var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
+  registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
+                            XULAPPINFO_CONTRACTID, XULAppInfoFactory);
+}
+
 function dummyTheme(id) {
   return {
     id: id,
     name: Math.random().toString(),
     headerURL: "http://lwttest.invalid/a.png",
     footerURL: "http://lwttest.invalid/b.png",
     textcolor: Math.random().toString(),
     accentcolor: Math.random().toString()
deleted file mode 100644
--- a/toolkit/components/telemetry/tests/unit/test_ThirdPartyCookieProbe.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-let Cu = Components.utils;
-let Cc = Components.classes;
-let Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/ThirdPartyCookieProbe.jsm");
-Cu.import("resource://gre/modules/commonjs/sdk/core/promise.js");
-
-let TOPIC_ACCEPTED = "third-party-cookie-accepted";
-let TOPIC_REJECTED = "third-party-cookie-rejected";
-
-let FLUSH_MILLISECONDS = 1000 * 60 * 60 * 24 / 2; /*Half a day, for testing purposes*/
-
-const NUMBER_OF_REJECTS = 30;
-const NUMBER_OF_ACCEPTS = 17;
-const NUMBER_OF_REPEATS = 5;
-
-const TelemetryPing = Cc["@mozilla.org/base/telemetry-ping;1"].getService(Ci.nsITelemetryPing);
-
-let gCookieService;
-let gThirdPartyCookieProbe;
-
-let gHistograms = {
-  clear: function() {
-    this.sitesAccepted.clear();
-    this.requestsAccepted.clear();
-    this.sitesRejected.clear();
-    this.requestsRejected.clear();
-  }
-};
-
-function run_test() {
-  do_print("Initializing environment");
-  do_get_profile();
-  createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-  gCookieService = Cc["@mozilla.org/cookieService;1"].getService(Ci.nsICookieService);
-
-  do_print("Initializing ThirdPartyCookieProbe.jsm");
-  gThirdPartyCookieProbe = new ThirdPartyCookieProbe();
-  gThirdPartyCookieProbe.init();
-
-  do_print("Acquiring histograms");
-  gHistograms.sitesAccepted =
-    Services.telemetry.getHistogramById("COOKIES_3RDPARTY_NUM_SITES_ACCEPTED");
-  gHistograms.sitesRejected =
-    Services.telemetry.getHistogramById("COOKIES_3RDPARTY_NUM_SITES_BLOCKED"),
-  gHistograms.requestsAccepted =
-    Services.telemetry.getHistogramById("COOKIES_3RDPARTY_NUM_ATTEMPTS_ACCEPTED");
-  gHistograms.requestsRejected =
-    Services.telemetry.getHistogramById("COOKIES_3RDPARTY_NUM_ATTEMPTS_BLOCKED"),
-
-
-  run_next_test();
-}
-
-/**
- * Utility function: try to set a cookie with the given document uri and referrer uri.
- *
- * @param obj An object with the following fields
- * - {string} request The uri of the request setting the cookie.
- * - {string} referrer The uri of the referrer for this request.
- */
-function tryToSetCookie(obj) {
-  let requestURI = Services.io.newURI(obj.request, null, null);
-  let referrerURI = Services.io.newURI(obj.referrer, null, null);
-  let requestChannel = Services.io.newChannelFromURI(requestURI);
-  gCookieService.setCookieString(referrerURI, null, "Is there a cookie in my jar?", requestChannel);
-}
-
-function wait(ms) {
-  let deferred = Promise.defer();
-  do_timeout(ms, () => deferred.resolve());
-  return deferred.promise;
-}
-
-function oneTest(tld, flushUptime, check) {
-  gHistograms.clear();
-  do_print("Testing with tld " + tld);
-
-  do_print("Adding rejected entries");
-  Services.prefs.setIntPref("network.cookie.cookieBehavior",
-                          1 /*reject third-party cookies*/);
-
-  for (let i = 0; i < NUMBER_OF_REJECTS; ++i) {
-    for (let j = 0; j < NUMBER_OF_REPEATS; ++j) {
-      for (let prefix of ["http://", "https://"]) {
-        // Histogram sitesRejected should only count
-        // NUMBER_OF_REJECTS entries.
-        // Histogram requestsRejected should count
-        // NUMBER_OF_REJECTS * NUMBER_OF_REPEATS * 2
-        tryToSetCookie({
-          request: prefix + "echelon" + tld,
-          referrer: prefix + "domain" + i + tld
-        });
-      }
-    }
-  }
-
-  do_print("Adding accepted entries");
-  Services.prefs.setIntPref("network.cookie.cookieBehavior",
-                            0 /*accept third-party cookies*/);
-
-  for (let i = 0; i < NUMBER_OF_ACCEPTS; ++i) {
-    for (let j = 0; j < NUMBER_OF_REPEATS; ++j) {
-      for (let prefix of ["http://", "https://"]) {
-        // Histogram sitesAccepted should only count
-        // NUMBER_OF_ACCEPTS entries.
-        // Histogram requestsAccepted should count
-        // NUMBER_OF_ACCEPTS * NUMBER_OF_REPEATS * 2
-        tryToSetCookie({
-            request: prefix + "prism" + tld,
-            referrer: prefix + "domain" + i + tld
-          });
-      }
-    }
-  }
-
-  do_print("Checking that the histograms have not changed before ping()");
-  do_check_eq(gHistograms.sitesAccepted.snapshot().sum, 0);
-  do_check_eq(gHistograms.sitesRejected.snapshot().sum, 0);
-  do_check_eq(gHistograms.requestsAccepted.snapshot().sum, 0);
-  do_check_eq(gHistograms.requestsRejected.snapshot().sum, 0);
-
-  do_print("Checking that the resulting histograms are correct");
-  if (flushUptime != null) {
-    let now = Date.now();
-    let before = now - flushUptime;
-    gThirdPartyCookieProbe._latestFlush = before;
-  }
-  gThirdPartyCookieProbe.flush();
-  check();
-}
-
-add_task(function() {
-  // To ensure that we work correctly with eTLD, test with several suffixes
-  for (let tld of [".com", ".com.ar", ".co.uk", ".gouv.fr"]) {
-    oneTest(tld, FLUSH_MILLISECONDS, function() {
-      do_check_eq(gHistograms.sitesAccepted.snapshot().sum, NUMBER_OF_ACCEPTS * 2);
-      do_check_eq(gHistograms.sitesRejected.snapshot().sum, NUMBER_OF_REJECTS * 2);
-      do_check_eq(gHistograms.requestsAccepted.snapshot().sum, NUMBER_OF_ACCEPTS * NUMBER_OF_REPEATS * 2 * 2);
-      do_check_eq(gHistograms.requestsRejected.snapshot().sum, NUMBER_OF_REJECTS * NUMBER_OF_REPEATS * 2 * 2);
-    });
-  }
-
-  // Check that things still work with default uptime management
-  for (let tld of [".com", ".com.ar", ".co.uk", ".gouv.fr"]) {
-    yield wait(1000); // Ensure that uptime is at least one second
-    oneTest(tld, null, function() {
-      do_check_true(gHistograms.sitesAccepted.snapshot().sum > 0);
-      do_check_true(gHistograms.sitesRejected.snapshot().sum > 0);
-      do_check_true(gHistograms.requestsAccepted.snapshot().sum > 0);
-      do_check_true(gHistograms.requestsRejected.snapshot().sum > 0);
-    });
-  }
-});
-
-add_task(function() {
-  gThirdPartyCookieProbe.dispose();
-});
-
--- a/toolkit/components/telemetry/tests/unit/xpcshell.ini
+++ b/toolkit/components/telemetry/tests/unit/xpcshell.ini
@@ -1,14 +1,13 @@
 [DEFAULT]
-head = head.js
+head = 
 tail = 
 
 [test_nsITelemetry.js]
 [test_TelemetryLateWrites.js]
 [test_TelemetryLockCount.js]
 [test_TelemetryPing.js]
 # Bug 676989: test fails consistently on Android
 # fail-if = os == "android"
 [test_TelemetryPing_idle.js]
 [test_TelemetryStopwatch.js]
 [test_TelemetryPingBuildID.js]
-[test_ThirdPartyCookieProbe.js]