зеркало из https://github.com/mozilla/gecko-dev.git
3. tests patch - Bug 843497 - Update check says 'up to date' for out of date versions on unsupported OS versions. r=bbondy
This commit is contained in:
Родитель
3102f2478e
Коммит
b737cf2528
|
@ -81,6 +81,8 @@ MOCHITEST_CHROME_FILES += \
|
|||
test_0141_notify_invalidCertAttrs_noUpdate.xul \
|
||||
test_0142_notify_invalidCertAttrs_hasUpdate.xul \
|
||||
test_0151_notify_backgroundCheckError.xul \
|
||||
test_0161_check_unsupported.xul \
|
||||
test_0162_notify_unsupported.xul \
|
||||
test_0900_deprecatedUpdateFormat_minor.xul \
|
||||
test_0901_deprecatedUpdateFormat_major.xul \
|
||||
test_9999_cleanup.xul \
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
<?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="Test checking for updates when system is no longer supported (bug 843497)"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="runTestDefault();">
|
||||
<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_UNSUPPORTED,
|
||||
buttonClick: "finish"
|
||||
} ];
|
||||
|
||||
function runTest() {
|
||||
debugDump("entering");
|
||||
|
||||
// When checking manually the unsupported page should still be shown even if
|
||||
// it was shown previously.
|
||||
Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
|
||||
|
||||
let url = URL_UPDATE + "?unsupported=1";
|
||||
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,44 @@
|
|||
<?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="Test notification of updates when system is no longer supported (bug 843497)"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="runTestDefault();">
|
||||
<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_UNSUPPORTED,
|
||||
buttonClick: "finish"
|
||||
} ];
|
||||
|
||||
function runTest() {
|
||||
debugDump("entering");
|
||||
|
||||
let url = URL_UPDATE + "?unsupported=1";
|
||||
setUpdateURLOverride(url);
|
||||
|
||||
gAUS.notify(null);
|
||||
}
|
||||
|
||||
]]>
|
||||
</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>
|
|
@ -87,6 +87,14 @@ function handleRequest(aRequest, aResponse) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (params.unsupported) {
|
||||
aResponse.write(getRemoteUpdatesXMLString(" <update type=\"major\" " +
|
||||
"unsupported=\"true\" " +
|
||||
"detailsURL=\"" + URL_HOST +
|
||||
"\"></update>\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
var hash;
|
||||
var patches = "";
|
||||
if (!params.partialPatchOnly) {
|
||||
|
|
|
@ -123,6 +123,7 @@ const PAGEID_CHECKING = "checking"; // Done
|
|||
const PAGEID_PLUGIN_UPDATES = "pluginupdatesfound";
|
||||
const PAGEID_NO_UPDATES_FOUND = "noupdatesfound"; // Done
|
||||
const PAGEID_MANUAL_UPDATE = "manualUpdate"; // Tested on license load failure
|
||||
const PAGEID_UNSUPPORTED = "unsupported"; // Done
|
||||
const PAGEID_INCOMPAT_CHECK = "incompatibleCheck"; // Done
|
||||
const PAGEID_FOUND_BASIC = "updatesfoundbasic"; // Done
|
||||
const PAGEID_FOUND_BILLBOARD = "updatesfoundbillboard"; // Done
|
||||
|
@ -553,6 +554,7 @@ function getExpectedButtonStates() {
|
|||
return { extra1: { disabled: false, hidden: false } };
|
||||
case PAGEID_NO_UPDATES_FOUND:
|
||||
case PAGEID_MANUAL_UPDATE:
|
||||
case PAGEID_UNSUPPORTED:
|
||||
case PAGEID_ERRORS:
|
||||
case PAGEID_ERROR_EXTRA:
|
||||
case PAGEID_INSTALLED:
|
||||
|
@ -962,6 +964,10 @@ function resetPrefs() {
|
|||
Services.prefs.clearUserPref(PREF_APP_UPDATE_SHOW_INSTALLED_UI);
|
||||
}
|
||||
|
||||
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED)) {
|
||||
Services.prefs.clearUserPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED);
|
||||
}
|
||||
|
||||
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LOG)) {
|
||||
Services.prefs.clearUserPref(PREF_APP_UPDATE_LOG);
|
||||
}
|
||||
|
|
|
@ -26,6 +26,7 @@ const PREF_APP_UPDATE_METRO_ENABLED = "app.update.metro.enabled";
|
|||
const PREF_APP_UPDATE_IDLETIME = "app.update.idletime";
|
||||
const PREF_APP_UPDATE_LOG = "app.update.log";
|
||||
const PREF_APP_UPDATE_NEVER_BRANCH = "app.update.never.";
|
||||
const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported";
|
||||
const PREF_APP_UPDATE_PROMPTWAITTIME = "app.update.promptWaitTime";
|
||||
const PREF_APP_UPDATE_SERVICE_ENABLED = "app.update.service.enabled";
|
||||
const PREF_APP_UPDATE_SHOW_INSTALLED_UI = "app.update.showInstalledUI";
|
||||
|
|
Загрузка…
Ссылка в новой задаче