Bug 1557478 (xpcshell test only) - Remove overrideUpdatePrompt and related code in xpcshellUtilsAUS.js. r=bytesized
authorRobert Strong <robert.bugzilla@gmail.com>
Thu, 06 Jun 2019 20:26:01 +0000
changeset 477694 40e030f0019d90fed5522cf3212fb5ea845f4597
parent 477693 7ce067624706c0623ebf97696ac30c3e3622495c
child 477695 91643c6f9a42b80a9e63db58931f8b4be8c6e69b
push id113372
push userdvarga@mozilla.com
push dateFri, 07 Jun 2019 10:07:35 +0000
treeherdermozilla-inbound@9909cd207cc2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbytesized
bugs1557478
milestone69.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 1557478 (xpcshell test only) - Remove overrideUpdatePrompt and related code in xpcshellUtilsAUS.js. r=bytesized This test helper code is no longer used Differential Revision: https://phabricator.services.mozilla.com/D34024
toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
@@ -3403,58 +3403,16 @@ function checkFilesInDirRecursive(aDir, 
         checkFilesInDirRecursive(entry, aCallback);
       } else {
         aCallback(entry);
       }
     }
   }
 }
 
-
-/**
- * Helper function to override the update prompt component to verify whether it
- * is called or not.
- *
- * @param   aCallback
- *          The callback to call if the update prompt component is called.
- */
-function overrideUpdatePrompt(aCallback) {
-  MockRegistrar.register("@mozilla.org/updates/update-prompt;1", UpdatePrompt, [aCallback]);
-}
-
-function UpdatePrompt(aCallback) {
-  this._callback = aCallback;
-
-  let fns = ["checkForUpdates", "showUpdateAvailable", "showUpdateDownloaded",
-             "showUpdateError", "showUpdateHistory", "showUpdateInstalled"];
-
-  fns.forEach(function UP_fns(aPromptFn) {
-    UpdatePrompt.prototype[aPromptFn] = function() {
-      if (!this._callback) {
-        return;
-      }
-
-      let callback = this._callback[aPromptFn];
-      if (!callback) {
-        return;
-      }
-
-      callback.apply(this._callback,
-                     Array.prototype.slice.call(arguments));
-    };
-  });
-}
-
-UpdatePrompt.prototype = {
-  flags: Ci.nsIClassInfo.SINGLETON,
-  getScriptableHelper: () => null,
-  interfaces: [Ci.nsISupports, Ci.nsIUpdatePrompt],
-  QueryInterface: ChromeUtils.generateQI([Ci.nsIClassInfo, Ci.nsIUpdatePrompt]),
-};
-
 /**
  * Waits for an update check request to complete.
  *
  * @param   aSuccess
  *          Whether the update check succeeds or not. If aSuccess is true then
  *          onCheckComplete should be called and if aSuccess is false then
  *          onError should be called.
  * @param   aExpectedValues