зеркало из https://github.com/mozilla/gecko-dev.git
Bug 617512 - Additional tests for deprecated update xml format. r=dtownsend, a=tests
This commit is contained in:
Родитель
23f7ae68a6
Коммит
1e6d44f319
|
@ -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)
|
||||
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
||||
|
||||
<window title="Update Wizard pages: minor update with deprecated update xml format"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="runTestDefault();">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
<script type="application/javascript"
|
||||
src="utils.js"/>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
const TESTS = [ {
|
||||
pageid: PAGEID_CHECKING
|
||||
}, {
|
||||
pageid: PAGEID_FOUND_BASIC,
|
||||
buttonClick: "extra1"
|
||||
} ];
|
||||
|
||||
function runTest() {
|
||||
debugDump("entering");
|
||||
|
||||
let url = URL_UPDATE + "?oldFormat=1&type=minor" + getVersionParams();
|
||||
setUpdateURLOverride(url);
|
||||
|
||||
gUP.checkForUpdates();
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
</body>
|
||||
</window>
|
|
@ -0,0 +1,57 @@
|
|||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
-->
|
||||
|
||||
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
|
||||
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
|
||||
|
||||
<window title="Update Wizard pages: major update with deprecated update xml format"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="runTestDefault();">
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/MochiKit/packed.js"/>
|
||||
<script type="application/javascript"
|
||||
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
|
||||
<script type="application/javascript"
|
||||
src="utils.js"/>
|
||||
|
||||
<script type="application/javascript">
|
||||
<![CDATA[
|
||||
|
||||
const TESTS = [ {
|
||||
pageid: PAGEID_CHECKING
|
||||
}, {
|
||||
pageid: PAGEID_FOUND_BILLBOARD,
|
||||
extraDelayedCheckFunction: checkRemoteContentState,
|
||||
expectedRemoteContentState: "loading",
|
||||
extraDelayedFinishFunction: addRemoteContentLoadListener,
|
||||
neverButton: true
|
||||
}, {
|
||||
pageid: PAGEID_FOUND_BILLBOARD,
|
||||
extraStartFunction: waitForRemoteContentLoaded,
|
||||
expectedRemoteContentState: "loaded",
|
||||
neverButton: true,
|
||||
buttonClick: "extra1"
|
||||
} ];
|
||||
|
||||
function runTest() {
|
||||
debugDump("entering");
|
||||
|
||||
let url = URL_UPDATE + "?oldFormat=1&type=major" + getVersionParams();
|
||||
setUpdateURLOverride(url);
|
||||
|
||||
gUP.checkForUpdates();
|
||||
}
|
||||
|
||||
]]>
|
||||
</script>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml">
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none"></div>
|
||||
<pre id="test"></pre>
|
||||
</body>
|
||||
</window>
|
|
@ -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));
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче