зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1390391 - Removing version parameter of javascript in test_device_sensor_event.html and test_reduce_time_precision.html. r=emk
This patch removes the version parameter in test_device_sensor_event.html and test_reduce_time_precision.html. In addition, it fixes eslint errors of test_reduce_time_precision.html. MozReview-Commit-ID: 4CVRQG8xgu3 --HG-- extra : rebase_source : 6ef87288d4a2380cf2bf5ede4b85d5394cafa0be
This commit is contained in:
Родитель
9bb23bd2e8
Коммит
ed18183009
|
@ -8,7 +8,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1369319
|
|||
<title>Test for Bug 1369319</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript;version=1.7">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 1369319 **/
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
|
|
@ -18,24 +18,24 @@ https://trac.torproject.org/projects/tor/ticket/1517
|
|||
<canvas id="test-canvas" width="100" height="100"></canvas>
|
||||
|
||||
<!-- The main testing script -->
|
||||
<script type="application/javascript;version=1.7">
|
||||
<script type="application/javascript">
|
||||
SimpleTest.requestFlakyTimeout("testing JS time-based fingerprinting");
|
||||
|
||||
// Prepare for test of AudioContext.currentTime
|
||||
let audioContext = new AudioContext();
|
||||
// Prepare for test of CanvasStream.currentTime
|
||||
let canvas = document.getElementById("test-canvas");
|
||||
let context = canvas.getContext('2d');
|
||||
let context = canvas.getContext("2d");
|
||||
context.fillText("test", 20, 20);
|
||||
let canvasStream = canvas.captureStream(25);
|
||||
|
||||
// Known ways to generate time stamps, in milliseconds
|
||||
const timeStampCodes = [
|
||||
'performance.now()',
|
||||
'new Date().getTime()',
|
||||
'new Event("").timeStamp',
|
||||
'new File([], "").lastModified',
|
||||
'new File([], "").lastModifiedDate.getTime()',
|
||||
"performance.now()",
|
||||
"new Date().getTime()",
|
||||
"new Event(\"\").timeStamp",
|
||||
"new File([], \"\").lastModified",
|
||||
"new File([], \"\").lastModifiedDate.getTime()",
|
||||
];
|
||||
|
||||
const kExpectedResolution = 100;
|
||||
|
@ -87,8 +87,8 @@ https://trac.torproject.org/projects/tor/ticket/1517
|
|||
|
||||
add_task(async function testDOM() {
|
||||
let timeStampCodesDOM = timeStampCodes.concat([
|
||||
'audioContext.currentTime * 1000',
|
||||
'canvasStream.currentTime * 1000',
|
||||
"audioContext.currentTime * 1000",
|
||||
"canvasStream.currentTime * 1000",
|
||||
]);
|
||||
// Loop through each timeStampCode, evaluate it,
|
||||
// and check if it is rounded to the nearest 100 ms.
|
||||
|
|
Загрузка…
Ссылка в новой задаче