diff --git a/toolkit/mozapps/update/test/chrome/Makefile.in b/toolkit/mozapps/update/test/chrome/Makefile.in index 35d3145e16d..eb6beb46266 100644 --- a/toolkit/mozapps/update/test/chrome/Makefile.in +++ b/toolkit/mozapps/update/test/chrome/Makefile.in @@ -101,6 +101,8 @@ _CHROME_FILES = \ test_0141_notify_invalidCertAttrs_noUpdate.xul \ test_0142_notify_invalidCertAttrs_hasUpdate.xul \ test_0151_notify_backgroundCheckError.xul \ + test_0900_deprecatedUpdateFormat_minor.xul \ + test_0901_deprecatedUpdateFormat_major.xul \ test_9999_cleanup.xul \ $(NULL) diff --git a/toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul b/toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul new file mode 100644 index 00000000000..d7d91a55b2b --- /dev/null +++ b/toolkit/mozapps/update/test/chrome/test_0900_deprecatedUpdateFormat_minor.xul @@ -0,0 +1,48 @@ + + + + + + + + + + +

+ +

+
+
diff --git a/toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul b/toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul new file mode 100644 index 00000000000..da8eae49dcb --- /dev/null +++ b/toolkit/mozapps/update/test/chrome/test_0901_deprecatedUpdateFormat_major.xul @@ -0,0 +1,57 @@ + + + + + + + + + + +

+ +

+
+
diff --git a/toolkit/mozapps/update/test/chrome/update.sjs b/toolkit/mozapps/update/test/chrome/update.sjs index cbede30f471..1e11b99fefe 100644 --- a/toolkit/mozapps/update/test/chrome/update.sjs +++ b/toolkit/mozapps/update/test/chrome/update.sjs @@ -123,13 +123,29 @@ function handleRequest(aRequest, aResponse) { var showPrompt = params.showPrompt ? "true" : null; var showNever = params.showNever ? "true" : null; var showSurvey = params.showSurvey ? "true" : null; - var extra1 = params.extra1 ? params.extra1 : null; + + // For testing the deprecated update xml format + if (params.oldFormat) { + appVersion = null; + displayVersion = null; + billboardURL = null; + showPrompt = null; + showNever = null; + showSurvey = null; + detailsURL = URL_UPDATE + "?uiURL=BILLBOARD"; + if (params.remoteNoTypeAttr) + detailsURL += "&remoteNoTypeAttr=1"; + var extensionVersion = params.appVersion ? params.appVersion : "99.9"; + var version = params.displayVersion ? params.displayVersion + : "version " + extensionVersion; + } + var updates = getRemoteUpdateString(patches, type, "App Update Test", displayVersion, appVersion, - platformVersion, buildID, - detailsURL, billboardURL, - licenseURL, showPrompt, - showNever, showSurvey, "test extra1"); + platformVersion, buildID, detailsURL, + billboardURL, licenseURL, showPrompt, + showNever, showSurvey, version, + extensionVersion); aResponse.write(getRemoteUpdatesXMLString(updates)); } diff --git a/toolkit/mozapps/update/test/unit/head_update.js.in b/toolkit/mozapps/update/test/unit/head_update.js.in index 8f72f7eb463..e3d3a7aff51 100644 --- a/toolkit/mozapps/update/test/unit/head_update.js.in +++ b/toolkit/mozapps/update/test/unit/head_update.js.in @@ -244,6 +244,32 @@ function runUpdate(aTestID) { return process.exitValue; } +/** + * Gets the platform specific shell binary that is launched using nsIProcess and + * in turn launches the updater. + * + * @return nsIFile for the shell binary to launch using nsIProcess. + * @throws if the shell binary doesn't exist. + */ +function getLaunchBin() { + let launchBin; + if (IS_WIN) { + launchBin = Services.dirsvc.get("WinD", AUS_Ci.nsIFile); + launchBin.append("System32"); + launchBin.append("cmd.exe"); + } + else { + launchBin = AUS_Cc["@mozilla.org/file/local;1"]. + createInstance(AUS_Ci.nsILocalFile); + launchBin.initWithPath("/bin/sh"); + } + + if (!launchBin.exists()) + do_throw(launchBin.path + " must exist to run this test!"); + + return launchBin; +} + /** * Helper function for updater tests for setting up the files and directories * used by the updater tests. diff --git a/toolkit/mozapps/update/test/unit/test_0060_manager.js b/toolkit/mozapps/update/test/unit/test_0060_manager.js index 375c722c0b3..e21af59861d 100644 --- a/toolkit/mozapps/update/test/unit/test_0060_manager.js +++ b/toolkit/mozapps/update/test/unit/test_0060_manager.js @@ -128,9 +128,6 @@ function run_test() { do_check_eq(update.detailsURL, "http://details2/"); do_check_eq(update.billboardURL, "http://details2/"); do_check_eq(update.licenseURL, null); - do_check_true(update.showPrompt); - do_check_true(update.showNeverForVersion); - do_check_false(update.showSurvey); do_check_eq(update.serviceURL, "http://service2/"); do_check_eq(update.installDate, "1238441400314"); do_check_eq(update.statusText, getString("patchApplyFailure")); @@ -197,15 +194,15 @@ function run_test() { do_check_eq(update.detailsURL, "http://details/"); do_check_eq(update.billboardURL, "http://billboard/"); do_check_eq(update.licenseURL, "http://license/"); - do_check_true(update.showPrompt); - do_check_true(update.showNeverForVersion); - do_check_true(update.showSurvey); do_check_eq(update.serviceURL, "http://service/"); do_check_eq(update.installDate, "1238441400314"); do_check_eq(update.statusText, getString("installSuccess")); do_check_eq(update.buildID, "20080811053724"); do_check_true(update.isCompleteUpdate); do_check_eq(update.channel, "test_channel"); + do_check_true(update.showPrompt); + do_check_true(update.showNeverForVersion); + do_check_true(update.showSurvey); do_check_eq(update.previousAppVersion, "3.0"); patch = update.selectedPatch; @@ -227,15 +224,15 @@ function run_test() { do_check_eq(update.detailsURL, "http://details/"); do_check_eq(update.billboardURL, null); do_check_eq(update.licenseURL, null); - do_check_false(update.showPrompt); - do_check_false(update.showNeverForVersion); - do_check_false(update.showSurvey); do_check_eq(update.serviceURL, "http://service/"); do_check_eq(update.installDate, "1238441400314"); do_check_eq(update.statusText, getString("patchApplyFailure")); do_check_eq(update.buildID, "20080811053724"); do_check_true(update.isCompleteUpdate); do_check_eq(update.channel, "test_channel"); + do_check_false(update.showPrompt); + do_check_false(update.showNeverForVersion); + do_check_false(update.showSurvey); do_check_eq(update.previousAppVersion, null); patch = update.selectedPatch; diff --git a/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js b/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js index 98b0f51d7c5..8660fbc6409 100644 --- a/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js +++ b/toolkit/mozapps/update/test/unit/test_0200_app_launch_apply_update.js @@ -192,11 +192,7 @@ function run_test() { let launchBin = getLaunchBin(); let args = getProcessArgs(); - let infoArgs = ""; - args.forEach(function(aArg) { - infoArgs += " " + aArg; - }); - logTestInfo("launching " + launchBin.path + infoArgs); + logTestInfo("launching " + launchBin.path + " " + args.join(" ")); gProcess = AUS_Cc["@mozilla.org/process/util;1"]. createInstance(AUS_Ci.nsIProcess); @@ -442,27 +438,6 @@ function resetEnvironment() { } } -/** - * Gets the platform specific binary used to launch the application using - * nsIProcess. - * - * @return nsIFile for the binary to launch using nsIProcess. - */ -function getLaunchBin() { - let launchBin; - if (IS_WIN) { - launchBin = Services.dirsvc.get("WinD", AUS_Ci.nsIFile); - launchBin.append("System32"); - launchBin.append("cmd.exe"); - } - else { - launchBin = AUS_Cc["@mozilla.org/file/local;1"]. - createInstance(AUS_Ci.nsILocalFile); - launchBin.initWithPath("/bin/sh"); - } - return launchBin; -} - /** * Returns the platform specific arguments used by nsIProcess when launching * the application.