Bug 1549835 - remove uiAutoPref.js, uiSilentPref.js, and uiUnsupportedAlreadyNotified.js xpcshell tests. r=bytesized

uiAutoPref.js and uiSilentPref.js test that the old app update UI behaves correctly and there is no corresponding functionality with the doorhangers so these tests should be removed.
The unsupported notification is now a doorhanger and already has tests so uiUnsupportedAlreadyNotified.js can be removed.

Differential Revision: https://phabricator.services.mozilla.com/D30268

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Robert Strong 2019-05-07 21:15:40 +00:00
Родитель bedf6775a2
Коммит c535f73b73
4 изменённых файлов: 0 добавлений и 204 удалений

Просмотреть файл

@ -1,71 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const WindowWatcher = {
openWindow(aParent, aUrl, aName, aFeatures, aArgs) {
check_showUpdateAvailable();
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowWatcher]),
};
const WindowMediator = {
getMostRecentWindow(aWindowType) {
executeSoon(check_status);
return null;
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowMediator]),
};
function run_test() {
setupTestCommon();
// Calling do_get_profile prevents an error from being logged
do_get_profile();
debugDump("testing that an update download doesn't start when the \"update " +
"auto\" value is false");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
start_httpserver();
setUpdateURL(gURLData + gHTTPHandlerPath);
standardInit();
let windowWatcherCID =
MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
WindowWatcher);
let windowMediatorCID =
MockRegistrar.register("@mozilla.org/appshell/window-mediator;1",
WindowMediator);
registerCleanupFunction(() => {
MockRegistrar.unregister(windowWatcherCID);
MockRegistrar.unregister(windowMediatorCID);
});
let patches = getRemotePatchString({});
let updates = getRemoteUpdateString({}, patches);
gResponseBody = getRemoteUpdatesXMLString(updates);
gAUS.notify(null);
}
function check_status() {
let status = readStatusFile();
Assert.notEqual(status, STATE_DOWNLOADING,
"the update state" + MSG_SHOULD_EQUAL);
// Cancel the download and reload the Update Manager with an empty update so
// the Application Update Service doesn't write the update xml files during
// xpcom-shutdown which will leave behind the test directory.
gAUS.stopDownload();
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), true);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
reloadUpdateManagerData();
executeSoon(doTestFinish);
}
function check_showUpdateAvailable() {
do_throw("showUpdateAvailable should not have called openWindow!");
}

Просмотреть файл

@ -1,58 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const WindowWatcher = {
openWindow(aParent, aUrl, aName, aFeatures, aArgs) {
do_throw("should not have called openWindow!");
},
getNewPrompter(aParent) {
do_throw("should not have seen getNewPrompter!");
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowWatcher]),
};
function run_test() {
setupTestCommon();
debugDump("testing nsIUpdatePrompt notifications should not be seen " +
"when the " + PREF_APP_UPDATE_SILENT + " preference is true");
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
let windowWatcherCID =
MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
WindowWatcher);
registerCleanupFunction(() => {
MockRegistrar.unregister(windowWatcherCID);
});
standardInit();
logTestInfo("testing showUpdateAvailable should not call openWindow");
let patchProps = {state: STATE_FAILED};
let patches = getLocalPatchString(patchProps);
let updates = getLocalUpdateString({}, patches);
writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
writeStatusFile(STATE_FAILED);
reloadUpdateManagerData();
let update = gUpdateManager.activeUpdate;
gUP.showUpdateAvailable(update);
// Report a successful check after the call to showUpdateAvailable since it
// didn't throw and otherwise it would report no tests run.
Assert.ok(true,
"calling showUpdateAvailable should not attempt to open a window");
logTestInfo("testing showUpdateError should not call getNewPrompter");
update.errorCode = WRITE_ERROR;
gUP.showUpdateError(update);
// Report a successful check after the call to showUpdateError since it
// didn't throw and otherwise it would report no tests run.
Assert.ok(true,
"calling showUpdateError should not attempt to open a window");
executeSoon(doTestFinish);
}

Просмотреть файл

@ -1,72 +0,0 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/
*/
const WindowWatcher = {
openWindow(aParent, aUrl, aName, aFeatures, aArgs) {
check_showUpdateAvailable();
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowWatcher]),
};
const WindowMediator = {
getMostRecentWindow(aWindowType) {
return null;
},
QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowMediator]),
};
function run_test() {
setupTestCommon();
debugDump("testing nsIUpdatePrompt notifications should not be displayed " +
"when showUpdateAvailable is called for an unsupported system " +
"update when the unsupported notification has already been " +
"shown (bug 843497)");
start_httpserver();
setUpdateURL(gURLData + gHTTPHandlerPath);
standardInit();
let windowWatcherCID =
MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
WindowWatcher);
let windowMediatorCID =
MockRegistrar.register("@mozilla.org/appshell/window-mediator;1",
WindowMediator);
registerCleanupFunction(() => {
MockRegistrar.unregister(windowWatcherCID);
MockRegistrar.unregister(windowMediatorCID);
});
Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
// This preference is used to determine when the background update check has
// completed since a successful check will clear the preference.
Services.prefs.setIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 1);
gResponseBody = getRemoteUpdatesXMLString(" <update type=\"major\" " +
"name=\"Unsupported Update\" " +
"unsupported=\"true\" " +
"detailsURL=\"" + URL_HOST +
"\"></update>\n");
gAUS.notify(null);
executeSoon(check_test);
}
function check_test() {
if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS)) {
executeSoon(check_test);
return;
}
Assert.ok(true,
PREF_APP_UPDATE_BACKGROUNDERRORS + " preference should not exist");
stop_httpserver(doTestFinish);
}
function check_showUpdateAvailable() {
do_throw("showUpdateAvailable should not have called openWindow!");
}

Просмотреть файл

@ -26,9 +26,6 @@ support-files =
[downloadInterruptedNoRecovery.js]
[downloadInterruptedRecovery.js]
[downloadResumeForSameAppVersion.js]
[uiSilentPref.js]
[uiUnsupportedAlreadyNotified.js]
[uiAutoPref.js]
[updateAutoPrefMigrate.js]
skip-if = os != 'win'
reason = Update pref migration is currently Windows only