Bug 1206346 P2 Back out Date.now() comparison to Performance.now() measurements. r=jdm
authorBen Kelly <ben@wanderview.com>
Sat, 20 Feb 2016 06:57:00 +0100
changeset 321877 406ee0a64991a8a9bc6b8ef9e1a27a16e80b9b15
parent 321876 9ecc9682c3a35496b18a114b85af871f1d6bffa4
child 321878 63fdedf32876a6c2776e72d8d882c8afd7475c5f
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs1206346
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1206346 P2 Back out Date.now() comparison to Performance.now() measurements. r=jdm
testing/web-platform/mozilla/tests/service-workers/service-worker/resources/performance-timeline-worker.js
--- a/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/performance-timeline-worker.js
+++ b/testing/web-platform/mozilla/tests/service-workers/service-worker/resources/performance-timeline-worker.js
@@ -2,44 +2,35 @@ importScripts('/resources/testharness.js
 
 promise_test(function(test) {
     var durationMsec = 100;
     // There are limits to our accuracy here.  Timers may fire up to a
     // millisecond early due to platform-dependent rounding.  In addition
     // the performance API introduces some rounding as well to prevent
     // timing attacks.
     var accuracy = 1.5;
-    var dateStart;
     return new Promise(function(resolve) {
-        dateStart = Date.now();
         performance.mark('startMark');
         setTimeout(resolve, durationMsec);
       }).then(function() {
           performance.mark('endMark');
-          var dateEnd = Date.now();
           performance.measure('measure', 'startMark', 'endMark');
           var startMark = performance.getEntriesByName('startMark')[0];
           var endMark = performance.getEntriesByName('endMark')[0];
           var measure = performance.getEntriesByType('measure')[0];
           assert_equals(measure.startTime, startMark.startTime);
           assert_approx_equals(endMark.startTime - startMark.startTime,
                                measure.duration, 0.001);
           assert_greater_than(measure.duration, durationMsec - accuracy);
           assert_equals(performance.getEntriesByType('mark').length, 2);
           assert_equals(performance.getEntriesByType('measure').length, 1);
           performance.clearMarks('startMark');
           performance.clearMeasures('measure');
           assert_equals(performance.getEntriesByType('mark').length, 1);
           assert_equals(performance.getEntriesByType('measure').length, 0);
-
-          // Performance API's fuzzy resolution means its measured duration
-          // can round to a slightly different value compared to Date.now()
-          // measurements.
-          var dateDuration = dateEnd - dateStart;
-          assert_approx_equals(Math.round(measure.duration), dateDuration, 1);
       });
   }, 'User Timing');
 
 promise_test(function(test) {
     return fetch('dummy.txt')
       .then(function(resp) {
           return resp.text();
         })