From 28ee054520120871a2b472569f4ec23e25deb681 Mon Sep 17 00:00:00 2001 From: Philipp von Weitershausen Date: Tue, 7 Sep 2010 15:57:04 +0200 Subject: [PATCH] Bug 594011 - test_history_store shoudn't use hardcoded timestamps [r=mconnor] Also simplify call to Sync. --- services/sync/tests/unit/test_history_store.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/services/sync/tests/unit/test_history_store.js b/services/sync/tests/unit/test_history_store.js index c239136c9dc3..63a0350a5242 100644 --- a/services/sync/tests/unit/test_history_store.js +++ b/services/sync/tests/unit/test_history_store.js @@ -4,9 +4,9 @@ Cu.import("resource://services-sync/type_records/history.js"); Cu.import("resource://services-sync/ext/Sync.js"); Cu.import("resource://services-sync/util.js"); -const TIMESTAMP1 = 1281077113313976; -const TIMESTAMP2 = 1281088209595212; -const TIMESTAMP3 = 1281199249129950; +const TIMESTAMP1 = (Date.now() - 103406528) * 1000; +const TIMESTAMP2 = (Date.now() - 6592903) * 1000; +const TIMESTAMP3 = (Date.now() - 123894) * 1000; function queryPlaces(uri, options) { let query = Svc.History.getNewQuery(); @@ -29,7 +29,7 @@ function queryHistoryVisits(uri) { } function waitForTitleChanged(test) { - let [exec, cb] = Sync.withCb(function (callback) { + Sync(function (callback) { Svc.History.addObserver({ onBeginUpdateBatch: function onBeginUpdateBatch() {}, onEndUpdateBatch: function onEndUpdateBatch() {}, @@ -51,8 +51,7 @@ function waitForTitleChanged(test) { ]) }, true); test(); - }); - exec(cb); + })(); } function run_test() {