Bug 1547844 - Remove redundant xpcshell downloading tests. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Tue, 30 Apr 2019 15:35:51 +0000
changeset 530796 40dcf4f4a5159f4372107d32219e7351a5ebe908
parent 530795 944e6bb582152425581c9764c6ebe70fdb554968
child 530797 0f5b654fe33f69c20f3c4fe3d18a5511813a79b7
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
bugs1547844
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 1547844 - Remove redundant xpcshell downloading tests. r=bytesized downloadMissingMar.js is already tested by browser_doorhanger_bc_downloadAutoFailures.js downloadInvalidSizeMar.js is already tested by several of the browser chrome tests with BadSize in the name. downloadCompleteAfterPartialFailure.js is already tested by browser_doorhanger_sp_patch_partialApplyFailure_complete.js and browser_doorhanger_sp_patch_partialApplyFailure_complete_staging.js Differential Revision: https://phabricator.services.mozilla.com/D29284
toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
toolkit/mozapps/update/tests/unit_aus_update/downloadInvalidSizeMar.js
toolkit/mozapps/update/tests/unit_aus_update/downloadMissingMar.js
toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const WindowWatcher = {
-  getNewPrompter: function WW_getNewPrompter(aParent) {
-    Assert.ok(!aParent,
-              "the aParent parameter should not be defined");
-    return {
-      alert: function WW_GNP_alert(aTitle, aText) {
-        let title = getString("updaterIOErrorTitle");
-        Assert.equal(aTitle, title,
-                     "the ui string for title" + MSG_SHOULD_EQUAL);
-        let text = gUpdateBundle.formatStringFromName("updaterIOErrorMsg",
-                                                      [Services.appinfo.name,
-                                                       Services.appinfo.name], 2);
-        Assert.equal(aText, text,
-                     "the ui string for message" + MSG_SHOULD_EQUAL);
-
-        executeSoon(doTestFinish);
-      },
-    };
-  },
-
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIWindowWatcher]),
-};
-
-function run_test() {
-  setupTestCommon();
-
-  debugDump("testing download a complete on partial failure. Calling " +
-            "nsIUpdatePrompt::showUpdateError should call getNewPrompter " +
-            "and alert on the object returned by getNewPrompter when the " +
-            "update.state == " + STATE_FAILED + " and the update.errorCode " +
-             "== " + WRITE_ERROR + " (Bug 595059).");
-
-  Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
-
-  let windowWatcherCID =
-    MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
-                           WindowWatcher);
-  registerCleanupFunction(() => {
-    MockRegistrar.unregister(windowWatcherCID);
-  });
-
-  standardInit();
-
-  let patchProps = {url: URL_HOST + "/" + FILE_COMPLETE_MAR,
-                    state: STATE_FAILED};
-  let patches = getLocalPatchString(patchProps);
-  let updates = getLocalUpdateString({}, patches);
-  writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-  writeStatusFile(STATE_FAILED);
-
-  reloadUpdateManagerData();
-
-  let update = gUpdateManager.activeUpdate;
-  update.errorCode = WRITE_ERROR;
-  let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
-                 createInstance(Ci.nsIUpdatePrompt);
-  prompter.showUpdateError(update);
-}
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadInvalidSizeMar.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-async function run_test() {
-  // The network code that downloads the mar file accesses the profile to cache
-  // the download, but the profile is only available after calling
-  // do_get_profile in xpcshell tests. This prevents an error from being logged.
-  do_get_profile();
-  setupTestCommon();
-  debugDump("testing mar download with an invalid file size");
-  Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
-  start_httpserver();
-  setUpdateURL(gURLData + gHTTPHandlerPath);
-  let patchProps = {size: "1024000"};
-  let patches = getRemotePatchString(patchProps);
-  let updates = getRemoteUpdateString({}, patches);
-  gResponseBody = getRemoteUpdatesXMLString(updates);
-  await waitForUpdateCheck(true, {updateCount: 1}).then(async (aArgs) => {
-    await waitForUpdateDownload(aArgs.updates, aArgs.updateCount,
-                                Cr.NS_ERROR_UNEXPECTED);
-  });
-  // There is a pending write to the xml files.
-  await waitForUpdateXMLFiles();
-  stop_httpserver(doTestFinish);
-}
deleted file mode 100644
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadMissingMar.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-async function run_test() {
-  // The network code that downloads the mar file accesses the profile to cache
-  // the download, but the profile is only available after calling
-  // do_get_profile in xpcshell tests. This prevents an error from being logged.
-  do_get_profile();
-  setupTestCommon();
-  debugDump("testing mar download with the mar not found");
-  Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
-  start_httpserver();
-  setUpdateURL(gURLData + gHTTPHandlerPath);
-  let patchProps = {url: gURLData + "missing.mar"};
-  let patches = getRemotePatchString(patchProps);
-  let updates = getRemoteUpdateString({}, patches);
-  gResponseBody = getRemoteUpdatesXMLString(updates);
-  await waitForUpdateCheck(true, {updateCount: 1}).then(async (aArgs) => {
-    await waitForUpdateDownload(aArgs.updates, aArgs.updateCount,
-                                Cr.NS_ERROR_UNEXPECTED);
-  });
-  // There is a pending write to the xml files.
-  await waitForUpdateXMLFiles();
-  stop_httpserver(doTestFinish);
-}
--- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
+++ b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
@@ -10,30 +10,27 @@ support-files =
   ../data/sharedUpdateXML.js
   ../data/xpcshellUtilsAUS.js
 
 [ausReadStrings.js]
 [canCheckForAndCanApplyUpdates.js]
 [urlConstruction.js]
 [updateManagerXML.js]
 [remoteUpdateXML.js]
-[downloadInvalidSizeMar.js]
-[downloadMissingMar.js]
 [cleanupDownloadingForOlderAppVersion.js]
 [cleanupDownloadingForDifferentChannel.js]
 [cleanupDownloadingForSameVersionAndBuildID.js]
 [cleanupDownloadingIncorrectStatus.js]
 [cleanupPendingVersionFileIncorrectStatus.js]
 [cleanupSuccessLogMove.js]
 [cleanupSuccessLogsFIFO.js]
 [downloadInterruptedOffline.js]
 [downloadInterruptedNoRecovery.js]
 [downloadInterruptedRecovery.js]
 [downloadResumeForSameAppVersion.js]
-[downloadCompleteAfterPartialFailure.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'