Bug 1466873 - [tps] Allow date property be optional when matching history entries; r=markh
authorDave Hunt <dhunt@mozilla.com>
Thu, 07 Jun 2018 16:53:39 +0100
changeset 422609 3774e59affc5fed9d9bcff7ecce0f1c46df4c738
parent 422608 b40de0d36037f68e747fb362d084a6858ac9b02f
child 422610 fc7a9042ec08b85734714d4f7bffb4e34ca0dd85
push id34139
push useraciure@mozilla.com
push dateFri, 15 Jun 2018 09:48:05 +0000
treeherdermozilla-central@dc997a4e045e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh
bugs1466873
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 1466873 - [tps] Allow date property be optional when matching history entries; r=markh MozReview-Commit-ID: 98eR1XFYpwE
services/sync/tps/extensions/tps/resource/modules/history.jsm
--- a/services/sync/tps/extensions/tps/resource/modules/history.jsm
+++ b/services/sync/tps/extensions/tps/resource/modules/history.jsm
@@ -81,18 +81,20 @@ var HistoryEntry = {
     Logger.AssertTrue("visits" in item && "uri" in item,
       "History entry in test file must have both 'visits' " +
       "and 'uri' properties");
     let curvisits = await PlacesSyncUtils.history.fetchVisitsForURL(item.uri);
     for (let visit of curvisits) {
       for (let itemvisit of item.visits) {
         // Note: in microseconds.
         let expectedDate = itemvisit.date * 60 * 60 * 1000 * 1000 + msSinceEpoch * 1000;
-        if (visit.type == itemvisit.type && visit.date == expectedDate) {
-          itemvisit.found = true;
+        if (visit.type == itemvisit.type) {
+          if (itemvisit.date === undefined || visit.date == expectedDate) {
+            itemvisit.found = true;
+          }
         }
       }
     }
 
     let all_items_found = true;
     for (let itemvisit of item.visits) {
       all_items_found = all_items_found && "found" in itemvisit;
       Logger.logInfo(