From b367c382417a8769d02dfb02639b0055dc62cef3 Mon Sep 17 00:00:00 2001 From: Tom Ritter Date: Tue, 20 Feb 2018 15:36:16 -0600 Subject: Bug 1430173 - Update tests for 2ms timers. r=baku, a=RyanVM MozReview-Commit-ID: 6xhQ71a5rDU --HG-- extra : transplant_source : %C2%D3%A7It%0Cg%92h%BB%3A%95%A2%0D.%86%B9C%9B%2B --- dom/events/test/test_eventTimeStamp.html | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) (limited to 'dom/events/test') diff --git a/dom/events/test/test_eventTimeStamp.html b/dom/events/test/test_eventTimeStamp.html index a3d096432..107a21f87 100644 --- a/dom/events/test/test_eventTimeStamp.html +++ b/dom/events/test/test_eventTimeStamp.html @@ -60,8 +60,8 @@ function testRegularEvents() { var timeBeforeEvent = window.performance.now(); window.addEventListener("load", function(evt) { var timeAfterEvent = window.performance.now(); - ok(evt.timeStamp > timeBeforeEvent && - evt.timeStamp < timeAfterEvent, + ok(evt.timeStamp >= timeBeforeEvent && + evt.timeStamp <= timeAfterEvent, "Event timestamp (" + evt.timeStamp + ") is in expected range: (" + timeBeforeEvent + ", " + timeAfterEvent + ")"); testWorkerEvents(); @@ -74,11 +74,12 @@ function testWorkerEvents() { var worker = new Worker(window.URL.createObjectURL(blob)); worker.onmessage = function(evt) { var timeAfterEvent = window.performance.now(); - ok(evt.data > timeBeforeEvent && - evt.data < timeAfterEvent, - "Event timestamp in dedicated worker (" + evt.data + - ") is in expected range: (" + - timeBeforeEvent + ", " + timeAfterEvent + ")"); + // Comparing times across timelines may break now + // ok(evt.data >= timeBeforeEvent && + // evt.data <= timeAfterEvent, + // "Event timestamp in dedicated worker (" + evt.data + + // ") is in expected range: (" + + // timeBeforeEvent + ", " + timeAfterEvent + ")"); worker.terminate(); testSharedWorkerEvents(); }; @@ -97,11 +98,12 @@ function testSharedWorkerEvents() { var worker = new SharedWorker(window.URL.createObjectURL(blob)); worker.port.onmessage = function(evt) { var timeAfterEvent = window.performance.now(); - ok(evt.data > 0 && - evt.data < timeAfterEvent - timeBeforeWorkerCreation, - "Event timestamp in shared worker (" + evt.data + - ") is in expected range: (0, " + - (timeAfterEvent - timeBeforeWorkerCreation) + ")"); + // Comparing times across timelines may break now + // ok(evt.data >= 0 && + // evt.data <= timeAfterEvent - timeBeforeWorkerCreation, + // "Event timestamp in shared worker (" + evt.data + + // ") is in expected range: (0, " + + // (timeAfterEvent - timeBeforeWorkerCreation) + ")"); worker.port.close(); finishTests(); }; -- cgit v1.2.3