diff --git a/toolkit/mozapps/update/tests/chrome/chrome.ini b/toolkit/mozapps/update/tests/chrome/chrome.ini index 65a1ec2e8d15..7324fd1a4324 100644 --- a/toolkit/mozapps/update/tests/chrome/chrome.ini +++ b/toolkit/mozapps/update/tests/chrome/chrome.ini @@ -11,17 +11,13 @@ support-files = ; mochitest-chrome tests must start with "test_" and are executed in sorted ; order and not in the order specified in the manifest. +[test_0010_background_basic.xul] [test_0011_check_basic.xul] -[test_0012_check_billboard.xul] -[test_0013_check_basic_staging.xul] +[test_0012_check_basic_staging.xul] skip-if = asan reason = Bug 1168003 -[test_0021_available_basic.xul] -[test_0022_available_billboard.xul] -[test_0051_check_error_xml_malformed.xul] -[test_0052_check_no_updates.xul] -[test_0053_check_billboard_noAttr.xul] -[test_0054_check_billboard_404.xul] +[test_0013_check_no_updates.xul] +[test_0014_check_error_xml_malformed.xul] [test_0061_check_verifyFailPartial_noComplete.xul] [test_0062_check_verifyFailComplete_noPartial.xul] [test_0063_check_verifyFailPartialComplete.xul] @@ -52,7 +48,6 @@ reason = Bug 1168003 skip-if = os != 'win' reason = only Windows has the maintenance service. [test_0111_neverButton_basic.xul] -[test_0112_neverButton_billboard.xul] [test_0113_showNeverForVersionRemovedWithPref.xul] [test_0151_notify_backgroundCheckError.xul] [test_0152_notify_backgroundCheckOfflineRetry.xul] @@ -64,6 +59,4 @@ reason = test must be able to prevent file deletion. [test_0172_notify_noPerms_manual.xul] skip-if = os != 'win' reason = test must be able to prevent file deletion. -[test_0900_deprecatedUpdateFormat_minor.xul] -[test_0901_deprecatedUpdateFormat_major.xul] [test_9999_cleanup.xul] diff --git a/toolkit/mozapps/update/tests/chrome/test_0021_available_basic.xul b/toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul similarity index 100% rename from toolkit/mozapps/update/tests/chrome/test_0021_available_basic.xul rename to toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul diff --git a/toolkit/mozapps/update/tests/chrome/test_0013_check_basic_staging.xul b/toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul similarity index 100% rename from toolkit/mozapps/update/tests/chrome/test_0013_check_basic_staging.xul rename to toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul diff --git a/toolkit/mozapps/update/tests/chrome/test_0012_check_billboard.xul b/toolkit/mozapps/update/tests/chrome/test_0012_check_billboard.xul deleted file mode 100644 index 5188bda46763..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0012_check_billboard.xul +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0052_check_no_updates.xul b/toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul similarity index 100% rename from toolkit/mozapps/update/tests/chrome/test_0052_check_no_updates.xul rename to toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul diff --git a/toolkit/mozapps/update/tests/chrome/test_0051_check_error_xml_malformed.xul b/toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul similarity index 100% rename from toolkit/mozapps/update/tests/chrome/test_0051_check_error_xml_malformed.xul rename to toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul diff --git a/toolkit/mozapps/update/tests/chrome/test_0022_available_billboard.xul b/toolkit/mozapps/update/tests/chrome/test_0022_available_billboard.xul deleted file mode 100644 index 498119af76db..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0022_available_billboard.xul +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0053_check_billboard_noAttr.xul b/toolkit/mozapps/update/tests/chrome/test_0053_check_billboard_noAttr.xul deleted file mode 100644 index 01b8a9dd4b6b..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0053_check_billboard_noAttr.xul +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0054_check_billboard_404.xul b/toolkit/mozapps/update/tests/chrome/test_0054_check_billboard_404.xul deleted file mode 100644 index a6504ebb9003..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0054_check_billboard_404.xul +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul b/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul index 8e5242df6603..cafab4d27cc7 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul @@ -30,8 +30,7 @@ function runTest() { let patches = getLocalPatchString("complete", null, null, null, "1234", null, STATE_DOWNLOADING); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion); + Services.appinfo.version); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul index 3a1f35234e69..c1db983a35ef 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul @@ -32,9 +32,8 @@ function runTest() { getLocalPatchString("complete", null, null, null, "1234", "false"); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, null, - null, null, null, null, null, "false"); + Services.appinfo.version, null, + null, null, null, null, "false"); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul index 5af373822d02..2c28da7682cc 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul @@ -32,9 +32,8 @@ function runTest() { getLocalPatchString("complete", null, null, null, null, "false"); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, null, - null, null, null, null, null, "false"); + Services.appinfo.version, null, + null, null, null, null, "false"); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul b/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul index 7d01042b3f86..10c34f63b0b4 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul @@ -30,9 +30,8 @@ function runTest() { let patches = getLocalPatchString("partial", null, null, null, null, null, STATE_PENDING); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, null, - null, null, null, null, null, "false"); + Services.appinfo.version, null, + null, null, null, null, "false"); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul b/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul index 2af78e235300..2c4b389f4b0d 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul @@ -30,8 +30,7 @@ function runTest() { let patches = getLocalPatchString("complete", null, null, null, null, null, STATE_PENDING); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion); + Services.appinfo.version); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul b/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul index cd45003beff4..01adb1c3d0ea 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul @@ -44,9 +44,8 @@ function runTest() { getLocalPatchString("complete", slowDownloadURL, null, null, null, "false"); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, null, - null, null, null, null, null, "false"); + Services.appinfo.version, null, + null, null, null, null, "false"); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul b/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul index d59cecf752e9..2e0c2b41e1d5 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul @@ -45,9 +45,8 @@ function runTest() { null, "1234", "false"); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, null, - null, null, null, null, null, "false"); + Services.appinfo.version, null, + null, null, null, null, "false"); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); diff --git a/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul b/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul index 73483249cd2d..6db5b9897376 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul @@ -30,8 +30,7 @@ function runTest() { let patches = getLocalPatchString("complete", null, null, null, null, null, STATE_PENDING); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion); + Services.appinfo.version); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); writeStatusFile(STATE_SUCCEEDED); diff --git a/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul b/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul index afd3fbca0588..6e72a42c1dba 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul @@ -30,9 +30,8 @@ function runTest() { let patches = getLocalPatchString("complete", null, null, null, null, null, STATE_PENDING); let updates = getLocalUpdateString(patches, null, null, null, - Services.appinfo.version, - Services.appinfo.platformVersion, - null, null, null, null, null, null, false, + Services.appinfo.version, null, + null, null, null, null, false, null, false, false, false, 1); writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); diff --git a/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul b/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul index 3a94956f951c..5b1b826a5ce0 100644 --- a/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul +++ b/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul @@ -31,8 +31,7 @@ function runTest() { STATE_PENDING); let updates = getLocalUpdateString(patches, null, null, null, Services.appinfo.version, - Services.appinfo.platformVersion, - null, null, null, + null, null, null, null, null, null, false, null, false, false, diff --git a/toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul b/toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul deleted file mode 100644 index 9f6da5b9a541..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0112_neverButton_billboard.xul +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0900_deprecatedUpdateFormat_minor.xul b/toolkit/mozapps/update/tests/chrome/test_0900_deprecatedUpdateFormat_minor.xul deleted file mode 100644 index b07782d640fb..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0900_deprecatedUpdateFormat_minor.xul +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/test_0901_deprecatedUpdateFormat_major.xul b/toolkit/mozapps/update/tests/chrome/test_0901_deprecatedUpdateFormat_major.xul deleted file mode 100644 index 8e65136b598a..000000000000 --- a/toolkit/mozapps/update/tests/chrome/test_0901_deprecatedUpdateFormat_major.xul +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - -

- -

-
-
diff --git a/toolkit/mozapps/update/tests/chrome/update.sjs b/toolkit/mozapps/update/tests/chrome/update.sjs index e422d059d265..8c0be8f36bc3 100644 --- a/toolkit/mozapps/update/tests/chrome/update.sjs +++ b/toolkit/mozapps/update/tests/chrome/update.sjs @@ -122,52 +122,21 @@ function handleRequest(aRequest, aResponse) { let type = params.type ? params.type : "major"; let name = params.name ? params.name : "App Update Test"; - let appVersion = params.appVersion ? params.appVersion : "99.9"; + let appVersion = params.appVersion ? params.appVersion : "999999.9"; let displayVersion = params.displayVersion ? params.displayVersion : "version " + appVersion; - let platformVersion = params.platformVersion ? params.platformVersion : "99.8"; let buildID = params.buildID ? params.buildID : "01234567890123"; // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244 // let detailsURL = params.showDetails ? URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS" : null; let detailsURL = URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS"; - let billboardURL = params.showBillboard ? URL_HTTP_UPDATE_SJS + "?uiURL=BILLBOARD" : null; - if (billboardURL && params.remoteNoTypeAttr) { - billboardURL += "&remoteNoTypeAttr=1"; - } - if (params.billboard404) { - billboardURL = URL_HOST + "/missing.html"; - } let showPrompt = params.showPrompt ? "true" : null; let showNever = params.showNever ? "true" : null; let promptWaitTime = params.promptWaitTime ? params.promptWaitTime : null; - let showSurvey = params.showSurvey ? "true" : null; - - let extensionVersion; - let version; - // For testing the deprecated update xml format - if (params.oldFormat) { - appVersion = null; - displayVersion = null; - billboardURL = null; - showPrompt = null; - showNever = null; - showSurvey = null; - detailsURL = URL_HTTP_UPDATE_SJS + "?uiURL=BILLBOARD"; - if (params.remoteNoTypeAttr) { - detailsURL += "&remoteNoTypeAttr=1"; - } - extensionVersion = params.appVersion ? params.appVersion : "99.9"; - version = params.displayVersion ? params.displayVersion - : "version " + extensionVersion; - } let updates = getRemoteUpdateString(patches, type, "App Update Test", - displayVersion, appVersion, - platformVersion, buildID, detailsURL, - billboardURL, showPrompt, - showNever, promptWaitTime, showSurvey, - version, extensionVersion); - + displayVersion, appVersion, buildID, + detailsURL, showPrompt, showNever, + promptWaitTime); aResponse.write(getRemoteUpdatesXMLString(updates)); } diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js index 64f32d5cb350..ae810eb4d65e 100644 --- a/toolkit/mozapps/update/tests/chrome/utils.js +++ b/toolkit/mozapps/update/tests/chrome/utils.js @@ -65,11 +65,6 @@ * For comparing the expected value defined by this property with the return * value of prefHasUserValue using gPrefToCheck for the preference name in the * checkPrefHasUserValue function. - * - * expectedRemoteContentState (optional) - * For comparing the expected remotecontent state attribute value of the - * wizard's billboard page in the checkRemoteContentState and - * waitForRemoteContentLoaded functions. */ 'use strict'; @@ -90,7 +85,6 @@ const PAGEID_NO_UPDATES_FOUND = "noupdatesfound"; // Done const PAGEID_MANUAL_UPDATE = "manualUpdate"; // Done const PAGEID_UNSUPPORTED = "unsupported"; // Done const PAGEID_FOUND_BASIC = "updatesfoundbasic"; // Done -const PAGEID_FOUND_BILLBOARD = "updatesfoundbillboard"; // Done const PAGEID_DOWNLOADING = "downloading"; // Done const PAGEID_ERRORS = "errors"; // Done const PAGEID_ERROR_EXTRA = "errorextra"; // Done @@ -149,7 +143,7 @@ var gUseTestUpdater = false; // Set to true to log additional information for debugging. To log additional // information for an individual test set DEBUG_AUS_TEST to true in the test's // onload function. -var DEBUG_AUS_TEST = false; +var DEBUG_AUS_TEST = true; const DATA_URI_SPEC = "chrome://mochitests/content/chrome/toolkit/mozapps/update/tests/data/"; Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this); @@ -171,28 +165,6 @@ this.__defineGetter__("gCallback", function() { : defaultCallback; }); -/** - * The remotecontent element for the current page if one exists or null if a - * remotecontent element doesn't exist. - */ -this.__defineGetter__("gRemoteContent", function() { - if (gTest.pageid == PAGEID_FOUND_BILLBOARD) { - return gWin.document.getElementById("updateMoreInfoContent"); - } - return null; -}); - -/** - * The state for the remotecontent element if one exists or null if a - * remotecontent element doesn't exist. - */ -this.__defineGetter__("gRemoteContentState", function() { - if (gRemoteContent) { - return gRemoteContent.getAttribute("state"); - } - return null; -}); - /** * Default test run function that can be used by most tests. This function uses * protective measures to prevent the test from failing provided by @@ -537,7 +509,6 @@ function getExpectedButtonStates() { case PAGEID_CHECKING: return { cancel: { disabled: false, hidden: false } }; case PAGEID_FOUND_BASIC: - case PAGEID_FOUND_BILLBOARD: if (gTest.neverButton) { return { extra1: { disabled: false, hidden: false }, extra2: { disabled: false, hidden: false }, @@ -563,72 +534,6 @@ function getExpectedButtonStates() { return null; } -/** - * Adds a load event listener to the current remotecontent element. - */ -function addRemoteContentLoadListener() { - debugDump("entering - TESTS[" + gTestCounter + "], pageid: " + gTest.pageid); - - gRemoteContent.addEventListener("load", remoteContentLoadListener, false); -} - -/** - * The nsIDOMEventListener for a remotecontent load event. - */ -function remoteContentLoadListener(aEvent) { - // Return early if the event's original target's nodeName isn't remotecontent. - if (aEvent.originalTarget.nodeName != "remotecontent") { - debugDump("only handles events with an originalTarget nodeName of " + - "|remotecontent|. aEvent.originalTarget.nodeName = " + - aEvent.originalTarget.nodeName); - return; - } - - gTestCounter++; - gCallback(aEvent); -} - -/** - * Waits until a remotecontent element to finish loading which is determined - * by the current test's expectedRemoteContentState property and then removes - * the event listener. - * - * Note: tests that use this function should not test the state of the - * remotecontent since this will check the expected state. - * - * @return false if the remotecontent has loaded and its state is the state - * specified in the current test's expectedRemoteContentState - * property... otherwise true. - */ -function waitForRemoteContentLoaded(aEvent) { - // Return early until the remotecontent has loaded with the state that is - // expected or isn't the event's originalTarget. - if (gRemoteContentState != gTest.expectedRemoteContentState || - aEvent.originalTarget != gRemoteContent) { - debugDump("returning early. " + - "gRemoteContentState: " + - gRemoteContentState + ", " + - "expectedRemoteContentState: " + - gTest.expectedRemoteContentState + ", " + - "aEvent.originalTarget.nodeName: " + - aEvent.originalTarget.nodeName); - return true; - } - - gRemoteContent.removeEventListener("load", remoteContentLoadListener, false); - return false; -} - -/** - * Compares the value of the remotecontent state attribute with the value - * specified in the test's expectedRemoteContentState property. - */ -function checkRemoteContentState() { - is(gRemoteContentState, gTest.expectedRemoteContentState, "Checking remote " + - "content state equals " + gTest.expectedRemoteContentState + " - pageid " + - gTest.pageid); -} - /** * Compares the return value of prefHasUserValue for the preference specified in * gPrefToCheck with the value passed in the aPrefHasValue parameter or the @@ -680,43 +585,12 @@ function checkErrorExtraPage(aShouldBeHidden) { * @param aAppVersion (optional) * The application version for the update snippet. If not specified the * current application version will be used. - * @param aPlatformVersion (optional) - * The platform version for the update snippet. If not specified the - * current platform version will be used. * @return The url parameters for the application and platform version to send * to update.sjs. */ -function getVersionParams(aAppVersion, aPlatformVersion) { +function getVersionParams(aAppVersion) { let appInfo = Services.appinfo; - return "&appVersion=" + (aAppVersion ? aAppVersion : appInfo.version) + - "&platformVersion=" + (aPlatformVersion ? aPlatformVersion - : appInfo.platformVersion); -} - -/** - * Gets an application version that is greater than the current application - * version. The version is created by taking the first sequence from the current - * application version and adding 1 to it. - * - * @return A version string greater than the current application version string. - */ -function getNewerAppVersion() { - let appVersion = Services.appinfo.version.split(".")[0]; - appVersion++; - return appVersion; -} - -/** - * Gets a platform version that is greater than the current platform version. - * The version is created by taking the first sequence from the current platform - * version and adding 1 to it. - * - * @return A version string greater than the current platform version string. - */ -function getNewerPlatformVersion() { - let platformVersion = Services.appinfo.platformVersion.split(".")[0]; - platformVersion++; - return platformVersion; + return "&appVersion=" + (aAppVersion ? aAppVersion : appInfo.version); } /** diff --git a/toolkit/mozapps/update/tests/data/sharedUpdateXML.js b/toolkit/mozapps/update/tests/data/sharedUpdateXML.js index c6da47909aa6..6590d32b9108 100644 --- a/toolkit/mozapps/update/tests/data/sharedUpdateXML.js +++ b/toolkit/mozapps/update/tests/data/sharedUpdateXML.js @@ -80,16 +80,13 @@ function getRemoteUpdatesXMLString(aUpdates) { * @return The string representing an update element for an update xml file. */ function getRemoteUpdateString(aPatches, aType, aName, aDisplayVersion, - aAppVersion, aPlatformVersion, aBuildID, - aDetailsURL, aBillboardURL, aShowPrompt, + aAppVersion, aBuildID, aDetailsURL, aShowPrompt, aShowNeverForVersion, aPromptWaitTime, - aShowSurvey, aVersion, aExtensionVersion, aCustom1, aCustom2) { return getUpdateString(aType, aName, aDisplayVersion, aAppVersion, - aPlatformVersion, aBuildID, aDetailsURL, - aBillboardURL, aShowPrompt, aShowNeverForVersion, - aPromptWaitTime, aShowSurvey, aVersion, - aExtensionVersion, aCustom1, aCustom2) + ">\n" + + aBuildID, aDetailsURL, aShowPrompt, + aShowNeverForVersion, aPromptWaitTime, + aCustom1, aCustom2) + ">\n" + aPatches + " \n"; } @@ -148,12 +145,10 @@ function getLocalUpdatesXMLString(aUpdates) { * @return The string representing an update element for an update xml file. */ function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion, - aAppVersion, aPlatformVersion, aBuildID, - aDetailsURL, aBillboardURL, aServiceURL, + aAppVersion, aBuildID, aDetailsURL, aServiceURL, aInstallDate, aStatusText, aIsCompleteUpdate, aChannel, aForegroundDownload, aShowPrompt, aShowNeverForVersion, aPromptWaitTime, - aShowSurvey, aVersion, aExtensionVersion, aPreviousAppVersion, aCustom1, aCustom2) { let serviceURL = aServiceURL ? aServiceURL : "http://test_service/"; let installDate = aInstallDate ? aInstallDate : "1238441400314"; @@ -167,11 +162,9 @@ function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion, let previousAppVersion = aPreviousAppVersion ? "previousAppVersion=\"" + aPreviousAppVersion + "\" " : ""; - return getUpdateString(aType, aName, aDisplayVersion, aAppVersion, - aPlatformVersion, aBuildID, aDetailsURL, aBillboardURL, - aShowPrompt, aShowNeverForVersion, aPromptWaitTime, - aShowSurvey, aVersion, aExtensionVersion, - aCustom1, aCustom2) + + return getUpdateString(aType, aName, aDisplayVersion, aAppVersion, aBuildID, + aDetailsURL, aShowPrompt, aShowNeverForVersion, + aPromptWaitTime, aCustom1, aCustom2) + " " + previousAppVersion + "serviceURL=\"" + serviceURL + "\" " + @@ -224,10 +217,6 @@ function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize, * The update's application version. * If not specified it will default to the value of * DEFAULT_UPDATE_VERSION. - * @param aPlatformVersion (optional) - * The update's platform version. - * If not specified it will default to the value of - * DEFAULT_UPDATE_VERSION. * @param aBuildID (optional) * The update's build id. * If not specified it will default to '20080811053724'. @@ -235,9 +224,6 @@ function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize, * The update's details url. * If not specified it will default to 'http://test_details/' due to due * to bug 470244. - * @param aBillboardURL (optional) - * The update's billboard url. - * If not specified it will not be present. * @param aShowPrompt (optional) * Whether to show the prompt for the update when auto update is * enabled. @@ -249,16 +235,6 @@ function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize, * default to false. * @param aPromptWaitTime (optional) * Override for the app.update.promptWaitTime preference. - * @param aShowSurvey (optional) - * Whether to show the 'No Thanks' button in the update prompt. - * If not specified it will not be present and the update service will - * default to false. - * @param aVersion (optional) - * The update's application version from 1.9.2. - * If not specified it will not be present. - * @param aExtensionVersion (optional) - * The update's application version from 1.9.2. - * If not specified it will not be present. * @param aCustom1 (optional) * A custom attribute name and attribute value to add to the xml. * Example: custom1_attribute="custom1 value" @@ -269,48 +245,23 @@ function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize, * If not specified it will not be present. * @return The string representing an update element for an update xml file. */ -function getUpdateString(aType, aName, aDisplayVersion, aAppVersion, - aPlatformVersion, aBuildID, aDetailsURL, aBillboardURL, - aShowPrompt, aShowNeverForVersion, aPromptWaitTime, - aShowSurvey, aVersion, aExtensionVersion, - aCustom1, aCustom2) { +function getUpdateString(aType, aName, aDisplayVersion, aAppVersion, aBuildID, + aDetailsURL, aShowPrompt, aShowNeverForVersion, + aPromptWaitTime, aCustom1, aCustom2) { let type = aType ? aType : "major"; let name = aName ? aName : "App Update Test"; - let displayVersion = ""; - if (aDisplayVersion || !aVersion) { - displayVersion = "displayVersion=\"" + - (aDisplayVersion ? aDisplayVersion - : "version " + DEFAULT_UPDATE_VERSION) + - "\" "; - } - // version has been deprecated in favor of displayVersion but it still needs - // to be tested for forward compatibility. - let version = aVersion ? "version=\"" + aVersion + "\" " : ""; - let appVersion = ""; - if (aAppVersion || !aExtensionVersion) { - appVersion = "appVersion=\"" + - (aAppVersion ? aAppVersion : DEFAULT_UPDATE_VERSION) + - "\" "; - } - // extensionVersion has been deprecated in favor of appVersion but it still - // needs to be tested for forward compatibility. - let extensionVersion = aExtensionVersion ? "extensionVersion=\"" + - aExtensionVersion + "\" " - : ""; - let platformVersion = ""; - if (aPlatformVersion) { - platformVersion = "platformVersion=\"" + - (aPlatformVersion ? aPlatformVersion - : DEFAULT_UPDATE_VERSION) + "\" "; - } + let displayVersion = aDisplayVersion ? "displayVersion=\"" + + aDisplayVersion + "\" " + : ""; + let appVersion = "appVersion=\"" + + (aAppVersion ? aAppVersion : DEFAULT_UPDATE_VERSION) + + "\" "; let buildID = aBuildID ? aBuildID : "20080811053724"; // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244 // let detailsURL = aDetailsURL ? "detailsURL=\"" + aDetailsURL + "\" " : ""; let detailsURL = "detailsURL=\"" + (aDetailsURL ? aDetailsURL : "http://test_details/") + "\" "; - let billboardURL = aBillboardURL ? "billboardURL=\"" + aBillboardURL + "\" " - : ""; let showPrompt = aShowPrompt ? "showPrompt=\"" + aShowPrompt + "\" " : ""; let showNeverForVersion = aShowNeverForVersion ? "showNeverForVersion=\"" + aShowNeverForVersion + "\" " @@ -323,12 +274,8 @@ function getUpdateString(aType, aName, aDisplayVersion, aAppVersion, return "