Bug 1330227 Tighten up mtime checking test_update.js r=rhelmer

MozReview-Commit-ID: Lk88rlRawZm

--HG--
extra : rebase_source : 793b14afdc0d755998a26c4fc903d1162070e982
This commit is contained in:
Andrew Swan 2017-06-12 14:27:01 -07:00
parent 2ade684a77
commit 4a96af84c8

View File

@ -232,6 +232,10 @@ for (let test of testParams) {
await promiseStartupManager();
// Grab the current time so we can check the mtime of the add-on below
// without worrying too much about how long other tests take.
let startupTime = Date.now();
do_check_true(isExtensionInAddonsList(profileDir, "addon1@tests.mozilla.org"));
AddonManager.getAddonByID("addon1@tests.mozilla.org", function(a1) {
@ -247,7 +251,7 @@ for (let test of testParams) {
// Make sure that the extension lastModifiedTime was updated.
let testURI = a1.getResourceURI(TEST_UNPACKED ? "install.rdf" : "");
let testFile = testURI.QueryInterface(Components.interfaces.nsIFileURL).file;
let difference = testFile.lastModifiedTime - Date.now();
let difference = testFile.lastModifiedTime - startupTime;
do_check_true(Math.abs(difference) < MAX_TIME_DIFFERENCE);
a1.uninstall();