Bug 1425462 Address tests for Time Jittering
The following tests all hardcoded a special value for Timer Precision Reduction.
browser/components/extensions/test/xpcshell/test_ext_browsingData_cookies_cache.js
browser/components/resistfingerprinting/test/browser/browser_performanceAPI.js
browser/components/resistfingerprinting/test/mochitest/test_animation_api.html
browser/components/resistfingerprinting/test/mochitest/test_reduce_time_precision.html
devtools/client/sourceeditor/test/browser_codemirror.js
dom/animation/test/css-animations/test_animation-currenttime.html
dom/animation/test/mozilla/test_transition_finish_on_compositor.html
dom/media/test/test_video_stats_resistfingerprinting.html
dom/tests/mochitest/ajax/jquery/test_jQuery.html
netwerk/test/unit/test_race_cache_with_network.js
Of these, only test_video_stats_resistfingerprinting.html begins failing when Jitter is enabled.
So disable jitter for that test.
Additionally, dom/midi/tests/test_midi_packet_timing_sorting.html began failing
with Jitter, so we disable it there. (We could easily modify the test so it began
passing, but this would reduce the effectiveness of the test.)
MozReview-Commit-ID: 2kipxV6wYv9
--- a/dom/media/test/test_video_stats_resistfingerprinting.html
+++ b/dom/media/test/test_video_stats_resistfingerprinting.html
@@ -22,16 +22,17 @@ https://trac.torproject.org/projects/tor
var manager = new MediaTestManager;
const SPOOFED_FRAMES_PER_SECOND = 30;
const SPOOFED_DROPPED_RATIO = 0.05;
// Push the setting of 'privacy.resistFingerprinting' into gTestPrefs, which
// will be set during MediaTestManager.runTests().
gTestPrefs.push(
["privacy.resistFingerprinting", true],
["privacy.resistFingerprinting.reduceTimerPrecision.microseconds", 100000],
+ ["privacy.resistFingerprinting.reduceTimerPrecision.jitter", false],
// We use 240p as the target resoultion since 480p is greater than every video
// source in our test suite, so we need to use 240p here for allowing us to
// test dropped rate here.
["privacy.resistFingerprinting.target_video_res", 240]
);
var testCases = [
{ name:"320x240.ogv", type:"video/ogg", width:320, height:240, duration:0.266, drop: false },
{ name:"seek.webm", type:"video/webm", width:320, height:240, duration:3.966, drop: false },
--- a/dom/midi/tests/test_midi_packet_timing_sorting.html
+++ b/dom/midi/tests/test_midi_packet_timing_sorting.html
@@ -8,16 +8,17 @@
</head>
<body onload="runTests()">
<script class="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
async function runTests() {
await MIDITestUtils.permissionSetup(true);
+ await SpecialPowers.pushPrefEnv({"set": [["privacy.resistFingerprinting.reduceTimerPrecision.jitter", false]]});
var checkCount = 0;
var lastTime = 0;
var reopened = false;
var input;
var output;
function checkReturn(event) {
ok(event.timeStamp > lastTime, "Received timestamp " + event.timeStamp + " should be greater than " + lastTime);
lastTime = event.timeStamp;