diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/libeditor/tests/test_dom_input_event_on_htmleditor.html | 20 | ||||
-rw-r--r-- | editor/libeditor/tests/test_dom_input_event_on_texteditor.html | 20 |
2 files changed, 10 insertions, 30 deletions
diff --git a/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html b/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html index d1716a228..dc8790750 100644 --- a/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html +++ b/editor/libeditor/tests/test_dom_input_event_on_htmleditor.html @@ -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; }; diff --git a/editor/libeditor/tests/test_dom_input_event_on_texteditor.html b/editor/libeditor/tests/test_dom_input_event_on_texteditor.html index b1395e99c..abdd5f5d0 100644 --- a/editor/libeditor/tests/test_dom_input_event_on_texteditor.html +++ b/editor/libeditor/tests/test_dom_input_event_on_texteditor.html @@ -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; }; |