mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877607 - Tests. r=gene.lian
This commit is contained in:
parent
8c0e7fa661
commit
86fdfbd03b
@ -51,8 +51,9 @@ function test() {
|
||||
}
|
||||
|
||||
function checkDataDates(data, start, end, sampleRate){
|
||||
start = Math.floor(start.getTime() / sampleRate) * sampleRate;
|
||||
end = Math.floor(end.getTime() / sampleRate) * sampleRate;
|
||||
var offset = (new Date()).getTimezoneOffset() * 60 * 1000;
|
||||
start = Math.floor((start.getTime() - offset) / sampleRate) * sampleRate + offset;
|
||||
end = Math.floor((end.getTime() - offset) / sampleRate) * sampleRate + offset;
|
||||
|
||||
var counter = 0;
|
||||
var date = start;
|
||||
@ -149,7 +150,9 @@ var steps = [
|
||||
// Get samplerate in millis
|
||||
var sampleRate = netStats.sampleRate * 1000;
|
||||
// Get date with samplerate's precision
|
||||
var endDate = new Date(Math.floor(new Date().getTime() / sampleRate) * sampleRate);
|
||||
var offset = new Date().getTimezoneOffset() * 60 * 1000;
|
||||
var endDate = new Date(Math.floor((new Date().getTime() - offset) / sampleRate)
|
||||
* sampleRate + offset);
|
||||
var startDate = new Date(endDate.getTime() - (sampleRate * diff));
|
||||
// Calculate the number of samples that should be returned based on the
|
||||
// the samplerate and including final and initial samples.
|
||||
@ -179,7 +182,9 @@ var steps = [
|
||||
// Get samplerate in millis
|
||||
var sampleRate = netStats.sampleRate * 1000;
|
||||
// Get date with samplerate's precision
|
||||
var endDate = new Date(Math.floor(new Date().getTime() / sampleRate) * sampleRate);
|
||||
var offset = new Date().getTimezoneOffset() * 60 * 1000;
|
||||
var endDate = new Date(Math.floor((new Date().getTime() - offset) / sampleRate)
|
||||
* sampleRate + offset);
|
||||
var startDate = new Date(endDate.getTime() - (sampleRate * diff));
|
||||
// Calculate the number of samples that should be returned based on the
|
||||
// the samplerate and including final and initial samples.
|
||||
|
Loading…
Reference in New Issue
Block a user