mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 1283720 - Follow-up: allow more fuzz in the test for clock-skew. r=annevk
--HG-- extra : rebase_source : 0891122df24f4e51c39bb0f87f2e5db59b963e62
This commit is contained in:
parent
43138c7126
commit
39990a833e
@ -10,7 +10,7 @@
|
||||
<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)
|
||||
@ -45,7 +45,7 @@
|
||||
|
||||
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')
|
||||
|
Loading…
Reference in New Issue
Block a user