Bug 1425462 Add gaussian prefs to all the tests, but do not do any testing of them draft
authorTom Ritter <tom@mozilla.com>
Fri, 15 Dec 2017 14:07:55 -0600
changeset 712213 f036a98572868caf0482c108ad8d1e3f73a07c0b
parent 712212 abe4382d41703de1cc575096b387346f11937547
child 743997 c37dde4c79f25ce3bccd3e70c0ba77da5624349a
push id93274
push userbmo:tom@mozilla.com
push dateFri, 15 Dec 2017 20:10:40 +0000
bugs1425462
milestone59.0a1
Bug 1425462 Add gaussian prefs to all the tests, but do not do any testing of them MozReview-Commit-ID: DzkXp8ugLdc
browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
browser/components/resistfingerprinting/test/mochitest/test_reduce_time_precision.html
--- a/browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
+++ b/browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
@@ -18,17 +18,19 @@ https://bugzilla.mozilla.org/show_bug.cg
   window.onload = () => {
     currentPref = "privacy.resistFingerprinting";
     expectedPrecision = 100000;
     SpecialPowers.pushPrefEnv({"set":
       [
         ["privacy.resistFingerprinting", true],
         ["dom.animations-api.core.enabled", true],
         ["privacy.reduceTimerPrecision", false],
-        ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+        ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+        ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+        ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
       ]
     }, runTest);
   };
 
   function runTest() {
     window.open("file_animation_api.html");
   }
 
@@ -48,89 +50,103 @@ https://bugzilla.mozilla.org/show_bug.cg
     if (completed == 1) {
       currentPref = "privacy.reduceTimerPrecision";
       expectedPrecision = 100000;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", false],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", true],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 2) {
       currentPref = "privacy.resistFingerprinting";
       expectedPrecision = 50000;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", true],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", false],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 3) {
       currentPref = "privacy.reduceTimerPrecision";
       expectedPrecision = 50000;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", false],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", true],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 4) {
       currentPref = "privacy.resistFingerprinting";
       expectedPrecision = 100;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", true],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", false],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 5) {
       currentPref = "privacy.reduceTimerPrecision";
       expectedPrecision = 100;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", false],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", true],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 6) {
       currentPref = "privacy.resistFingerprinting";
       expectedPrecision = 13;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", true],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", false],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else if (completed == 7) {
       currentPref = "privacy.reduceTimerPrecision";
       expectedPrecision = 13;
       SpecialPowers.pushPrefEnv({"set":
         [
           ["privacy.resistFingerprinting", false],
           ["dom.animations-api.core.enabled", true],
           ["privacy.reduceTimerPrecision", true],
-          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision]
+          ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+          ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
         ]
       }, runTest);
     // ----------------------------------------------
     } else {
       ok(false, "I seem to have asked for " + numTests +
          " tests, but don't know how to run them all.");
       SimpleTest.finish();
     }
--- a/browser/components/resistfingerprinting/test/mochitest/test_reduce_time_precision.html
+++ b/browser/components/resistfingerprinting/test/mochitest/test_reduce_time_precision.html
@@ -122,17 +122,19 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = 100;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.resistFingerprinting", expectedPrecision);
     await checkWorker(worker2, "privacy.resistFingerprinting", expectedPrecision);
   });
@@ -141,17 +143,19 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = 13;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.resistFingerprinting", expectedPrecision);
     await checkWorker(worker2, "privacy.resistFingerprinting", expectedPrecision);
   });
@@ -160,17 +164,19 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = .13;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.resistFingerprinting", expectedPrecision);
     await checkWorker(worker2, "privacy.resistFingerprinting", expectedPrecision);
   });
@@ -179,17 +185,19 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = 100;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.reduceTimerPrecision", expectedPrecision);
     await checkWorker(worker2, "privacy.reduceTimerPrecision", expectedPrecision);
   });
@@ -198,17 +206,19 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = 13;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.reduceTimerPrecision", expectedPrecision);
     await checkWorker(worker2, "privacy.reduceTimerPrecision", expectedPrecision);
   });
@@ -217,82 +227,96 @@ https://trac.torproject.org/projects/tor
     // Create one worker before setting the pref, and one after, in order to
     // check that the resolution is updated whether or not the worker was
     // already started
     let expectedPrecision = .13;
     let worker1 = new Worker("worker_child.js");
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     let worker2 = new Worker("worker_child.js");
     // Allow ~550 ms to elapse, so we can get non-zero
     // time values for all elements.
     await new Promise(resolve => window.setTimeout(resolve, 550));
     await checkWorker(worker1, "privacy.reduceTimerPrecision", expectedPrecision);
     await checkWorker(worker2, "privacy.reduceTimerPrecision", expectedPrecision);
   });
 
   add_task(async function testDOMRFP1() {
     let expectedPrecision = 100;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.resistFingerprinting", expectedPrecision);
   });
 
   add_task(async function testDOMRFP2() {
     let expectedPrecision = 13;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.resistFingerprinting", expectedPrecision);
   });
 
   add_task(async function testDOMRFP3() {
     let expectedPrecision = .13;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", true],
               ["privacy.reduceTimerPrecision", false],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.resistFingerprinting", expectedPrecision);
   });
 
   add_task(async function testDOMRTP1() {
     let expectedPrecision = 100;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.reduceTimerPrecision", expectedPrecision);
   });
 
   add_task(async function testDOMRTP2() {
     let expectedPrecision = 13;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.reduceTimerPrecision", expectedPrecision);
   });
 
   add_task(async function testDOMRTP3() {
     let expectedPrecision = .13;
     await SpecialPowers.pushPrefEnv({
       "set": [["privacy.resistFingerprinting", false],
               ["privacy.reduceTimerPrecision", true],
-              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000]
+              ["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", expectedPrecision * 1000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.a", 10000],
+              ["privacy.resistFingerprinting.reduceTimerPrecision.gaussian.b", 0]
               ]});
     checkTimestamps("privacy.reduceTimerPrecision", expectedPrecision);
   });
 
 </script>
 
 
 </body>