Bug 1283720 - Follow-up: allow more fuzz in the test for clock-skew. r=annevk
authorThomas Wisniewski <wisniewskit@gmail.com>
Mon, 12 Sep 2016 10:03:59 -0400
changeset 357114 13e73ff5d5d4e7e8141fae1024767a9ad34093a1
parent 357113 71bc393f6890d2b72d07a11b2f8598014c2c2b2c
child 357115 d863b2778bdb658495eabeb3e81bf19b6390ac85
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersannevk
bugs1283720
milestone51.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 1283720 - Follow-up: allow more fuzz in the test for clock-skew. r=annevk
testing/web-platform/tests/XMLHttpRequest/responsexml-document-properties.htm
--- a/testing/web-platform/tests/XMLHttpRequest/responsexml-document-properties.htm
+++ b/testing/web-platform/tests/XMLHttpRequest/responsexml-document-properties.htm
@@ -5,17 +5,17 @@
     <script src="/resources/testharness.js"></script>
     <script src="/resources/testharnessreport.js"></script>
     <link rel="help" href="https://xhr.spec.whatwg.org/#the-responsexml-attribute" data-tested-assertations="following::ol[1]/li[4]" />
     <link rel="help" href="https://xhr.spec.whatwg.org/#document-response-entity-body" data-tested-assertations="following::ol[1]/li[6] following::ol[1]/li[7] following::ol[1]/li[8] following::ol[1]/li[10]" />
   </head>
   <body>
     <div id="log"></div>
     <script>
-      var timePreXHR = Math.floor(new Date().getTime() / 1000);
+      var timePreXHR = Math.floor(new Date().getTime(new Date().getTime() - 3000) / 1000); // three seconds ago, in case there's clock drift
       var client = new XMLHttpRequest()
       client.open("GET", "resources/well-formed.xml", false)
       client.send(null)
       var expected = {
         domain:undefined,
         URL:location.href.replace(/[^/]*$/, 'resources/well-formed.xml'),
         documentURI:location.href.replace(/[^/]*$/, 'resources/well-formed.xml'),
         referrer:'',
@@ -40,17 +40,17 @@
       function runTest(name, value){
         test(function(){
           assert_equals(client.responseXML[name], value)
         }, name)
       }
 
       test(function() {
         var lastModified = Math.floor(new Date(client.responseXML.lastModified).getTime() / 1000);
-        var now = Math.floor(new Date().getTime(new Date().getTime() + 2000) / 1000); // two seconds from now, in case there's clock drift
+        var now = Math.floor(new Date().getTime(new Date().getTime() + 3000) / 1000); // three seconds from now, in case there's clock drift
         assert_greater_than_equal(lastModified, timePreXHR);
         assert_less_than_equal(lastModified, now);
       }, 'lastModified set to time of response if no HTTP header provided')
 
       test(function() {
         var client2 = new XMLHttpRequest()
         client2.open("GET", "resources/last-modified.py", false)
         client2.send(null)