diff --git a/toolkit/mozapps/update/src/nsUpdateService.js.in b/toolkit/mozapps/update/src/nsUpdateService.js.in index fbaba51e627..6a1650dd720 100644 --- a/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -1372,7 +1372,7 @@ UpdateService.prototype = { getService(Ci.nsIVersionComparator); for (var i = 0; i < updates.length; ++i) { // Ignore updates for older versions of the application - if (vc.compare(updates[i].version, gApp.version) < 0) + if (vc.compare(updates[i].extensionVersion, gApp.version) < 0) continue; if (updates[i].type == "major" && vc.compare(newestMajor.version, updates[i].version) <= 0) @@ -1804,9 +1804,9 @@ UpdateService.prototype = { getService(Ci.nsIVersionComparator); // Don't download the update if the update's version is less than the // current application's version. - if (update.version && vc.compare(update.version, ai.version) < 0) { + if (update.extensionVersion && vc.compare(update.extensionVersion, ai.version) < 0) { LOG("UpdateService", "downloadUpdate - removing update for previous " + - "application version " + update.version); + "application version " + update.extensionVersion); cleanupActiveUpdate(); return STATE_NONE; } diff --git a/toolkit/mozapps/update/test/unit/test_0020_general.js b/toolkit/mozapps/update/test/unit/test_0020_general.js index bf451f8de8a..cb493c9705e 100644 --- a/toolkit/mozapps/update/test/unit/test_0020_general.js +++ b/toolkit/mozapps/update/test/unit/test_0020_general.js @@ -249,13 +249,13 @@ function run_test_pt10() { "e6678ca40ae7582316acdeddf3c133c9c8577de4", "1316138"); var updates = getRemoteUpdateString(patches, "XPCShell App Update Test", - "minor", "1.0pre", "2.0", - "3.0", "20080811053724", + "minor", "version 1.0pre", "2.0", + "1.0pre", "20080811053724", "http://dummylicense/index.html", "http://dummydetails/index.html"); updates += getRemoteUpdateString(patches, "XPCShell App Update Test", - "minor", "1.0a", "2.0", - "3.0", "20080811053724", + "minor", "version 1.0a", "3.0", + "1.0a", "20080811053724", "http://dummylicense/index.html", "http://dummydetails/index.html"); gResponseBody = getRemoteUpdatesXMLString(updates); @@ -278,8 +278,8 @@ function run_test_pt11() { "e6678ca40ae7582316acdeddf3c133c9c8577de4", "1316138"); var updates = getRemoteUpdateString(patches, "XPCShell App Update Test", - "minor", "1.0", "2.0", - "3.0", "20080811053724", + "minor", "version 1.0", "3.0", + "1.0", "20080811053724", "http://dummylicense/index.html", "http://dummydetails/index.html"); gResponseBody = getRemoteUpdatesXMLString(updates); @@ -290,6 +290,6 @@ function run_test_pt11() { function check_test_pt11() { var bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount); do_check_neq(bestUpdate, null); - do_check_eq(bestUpdate.version, "1.0"); + do_check_eq(bestUpdate.version, "version 1.0"); end_test(); }