Bug 1469104 - Fix testcase in browser_sanitize-timespans to not fail immediately after midnight. r=mak
authorJonathan Kew <jkew@mozilla.com>
Wed, 20 Jun 2018 12:34:05 +0100
changeset 423152 ef348f3f604cf27dcc7a8575eea682db1a9e8809
parent 423151 8644e415f6ba781c97fdd43dc11f29f27a823132
child 423153 0b026cd7903d9de7ff047550a73600fe2a8101b7
push id34164
push usercsabou@mozilla.com
push dateThu, 21 Jun 2018 01:17:13 +0000
treeherdermozilla-central@d231a3231680 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1469104
milestone62.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 1469104 - Fix testcase in browser_sanitize-timespans to not fail immediately after midnight. r=mak
browser/base/content/test/sanitize/browser_sanitize-timespans.js
--- a/browser/base/content/test/sanitize/browser_sanitize-timespans.js
+++ b/browser/base/content/test/sanitize/browser_sanitize-timespans.js
@@ -448,17 +448,18 @@ async function setupHistory() {
   addPlace("http://2hour.com/", "Less than 2 hours ago", now_uSec - 90 * kUsecPerMin);
   addPlace("http://2hour10minutes.com/", "2 hours 10 minutes ago", now_uSec - 130 * kUsecPerMin);
   addPlace("http://4hour.com/", "Less than 4 hours ago", now_uSec - 180 * kUsecPerMin);
   addPlace("http://4hour10minutes.com/", "4 hours 10 minutesago", now_uSec - 250 * kUsecPerMin);
 
   let today = new Date();
   today.setHours(0);
   today.setMinutes(0);
-  today.setSeconds(1);
+  today.setSeconds(0);
+  today.setMilliseconds(1);
   addPlace("http://today.com/", "Today", today.getTime() * 1000);
 
   let lastYear = new Date();
   lastYear.setFullYear(lastYear.getFullYear() - 1);
   addPlace("http://before-today.com/", "Before Today", lastYear.getTime() * 1000);
   await PlacesTestUtils.addVisits(places);
 }
 
@@ -559,17 +560,18 @@ async function setupFormHistory() {
 
   timestamp = now_uSec - 250 * kUsecPerMin;
   results = await searchEntries(["guid"], { fieldname: "4hour10minutes" });
   await update({ op: "update", firstUsed: timestamp, guid: results[0].guid });
 
   let today = new Date();
   today.setHours(0);
   today.setMinutes(0);
-  today.setSeconds(1);
+  today.setSeconds(0);
+  today.setMilliseconds(1);
   timestamp = today.getTime() * 1000;
   results = await searchEntries(["guid"], { fieldname: "today" });
   await update({ op: "update", firstUsed: timestamp, guid: results[0].guid });
 
   let lastYear = new Date();
   lastYear.setFullYear(lastYear.getFullYear() - 1);
   timestamp = lastYear.getTime() * 1000;
   results = await searchEntries(["guid"], { fieldname: "b4today" });
@@ -650,17 +652,18 @@ async function setupDownloads() {
   download.startTime = new Date(now_mSec - 250 * kMsecPerMin), // 250 minutes ago
   download.canceled = true;
   await publicList.add(download);
 
   // Add "today" download
   let today = new Date();
   today.setHours(0);
   today.setMinutes(0);
-  today.setSeconds(1);
+  today.setSeconds(0);
+  today.setMilliseconds(1);
 
   download = await Downloads.createDownload({
     source: "https://bugzilla.mozilla.org/show_bug.cgi?id=453440",
     target: "fakefile-today"
   });
   download.startTime = today, // 12:00:01 AM this morning
   download.canceled = true;
   await publicList.add(download);