diff options
author | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2020-02-25 15:07:00 -0500 |
commit | 0ddd00f1959c78ce37c14fef3c83401408fca3bf (patch) | |
tree | d408e02767c86cf8aac3acbb86722b03c77ede6f /toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js | |
parent | 20f0905b33cbb18d1caa80c55e2f552c2e18957b (diff) | |
download | UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.gz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.lz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.tar.xz UXP-0ddd00f1959c78ce37c14fef3c83401408fca3bf.zip |
Issue #439 - Remove tests from toolkit/
Diffstat (limited to 'toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js')
-rw-r--r-- | toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js b/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js deleted file mode 100644 index 25110be8c..000000000 --- a/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js +++ /dev/null @@ -1,76 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - * http://creativecommons.org/publicdomain/zero/1.0/ - */ - -Components.utils.import("resource://testing-common/MockRegistrar.jsm"); - -/** - * Test that nsIUpdatePrompt doesn't display UI for showUpdateAvailable and - * showUpdateError when the app.update.silent preference is true. - */ - -const WindowWatcher = { - openWindow: function(aParent, aUrl, aName, aFeatures, aArgs) { - gCheckFunc(); - }, - - getNewPrompter: function(aParent) { - gCheckFunc(); - }, - - QueryInterface: XPCOMUtils.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); - do_register_cleanup(() => { - MockRegistrar.unregister(windowWatcherCID); - }); - - standardInit(); - - debugDump("testing showUpdateAvailable should not call openWindow"); - writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false); - let patches = getLocalPatchString(null, null, null, null, null, null, - STATE_FAILED); - let updates = getLocalUpdateString(patches); - writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true); - writeStatusFile(STATE_FAILED); - reloadUpdateManagerData(); - - gCheckFunc = check_showUpdateAvailable; - 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"); - - debugDump("testing showUpdateError should not call getNewPrompter"); - gCheckFunc = check_showUpdateError; - 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"); - - doTestFinish(); -} - -function check_showUpdateAvailable() { - do_throw("showUpdateAvailable should not have called openWindow!"); -} - -function check_showUpdateError() { - do_throw("showUpdateError should not have seen getNewPrompter!"); -} |