Bug 1549835 - remove uiAutoPref.js, uiSilentPref.js, and uiUnsupportedAlreadyNotified.js xpcshell tests. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 07 May 2019 21:15:40 +0000
changeset 531791 ac53bb1ed24af124bdb644067dda1fd7a41f4924
parent 531790 54626a60a4ab45899f8c43cb42abc5d03025fd5d
child 531792 e20b442b0ee386a6bd20b562d0e381eec4f41ca5
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1549835
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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
toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js
toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js
+++ /dev/null
@@ -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!");
-}
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
+++ /dev/null
@@ -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);
-}
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
+++ /dev/null
@@ -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!");
-}
--- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
@@ -21,17 +21,14 @@ support-files =
 [cleanupDownloadingIncorrectStatus.js]
 [cleanupPendingVersionFileIncorrectStatus.js]
 [cleanupSuccessLogMove.js]
 [cleanupSuccessLogsFIFO.js]
 [downloadInterruptedOffline.js]
 [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
 [updateDirectoryMigrate.js]
 skip-if = os != 'win'
 reason = Update directory migration is currently Windows only