Issue #1517 - Remove dom.event.highrestimestamp.enabled pref

This resolves #1517
This commit is contained in:
Moonchild 2020-05-04 13:11:28 +00:00 • committed by Roy Tam
commit d62f0a0dd2
6 changed files with 14 additions and 59 deletions

View file

@ -67,21 +67,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
} else {
var eventTime = new Date(aEvent.timeStamp);
var duration = Math.abs(Date.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" +
eventTime.toLocaleString() +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
}
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
inputEvent = aEvent;
};

View file

@ -41,21 +41,11 @@ function runTests()
"input event is fired on unexpected element: " + aEvent.target.tagName);
ok(!aEvent.cancelable, "input event must not be cancelable");
ok(aEvent.bubbles, "input event must be bubbles");
if (SpecialPowers.getBoolPref("dom.event.highrestimestamp.enabled")) {
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
} else {
var eventTime = new Date(aEvent.timeStamp);
var duration = Math.abs(Date.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" +
eventTime.toLocaleString() +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
}
var duration = Math.abs(window.performance.now() - aEvent.timeStamp);
ok(duration < 30 * 1000,
"perhaps, timestamp wasn't set correctly :" + aEvent.timeStamp +
" (expected it to be within 30s of the current time but it " +
"differed by " + duration + "ms)");
inputEvent = aEvent;
};