Bug 1617887 - remove controllerAdditions and friends. r=khushil
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 30 Jun 2020 23:35:34 +0300
changeset 30025 ee5eb95ccf70ffcf8e4b32a0d88386353a2f16ce
parent 30024 9dc474fda8ab3c2c8ada0a53c88c118c6d5d6de5
child 30026 a37d8583cbd00751deff2559113854e37bd7a448
push id17651
push usermkmelin@iki.fi
push dateTue, 30 Jun 2020 20:37:33 +0000
treeherdercomm-central@ee5eb95ccf70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhushil
bugs1617887
Bug 1617887 - remove controllerAdditions and friends. r=khushil
mail/test/browser/shared-modules/WindowHelpers.jsm
mail/test/browser/shared-modules/controller.jsm
--- a/mail/test/browser/shared-modules/WindowHelpers.jsm
+++ b/mail/test/browser/shared-modules/WindowHelpers.jsm
@@ -1730,22 +1730,16 @@ function __popup_hidden(event) {
     "target:",
     normalize_for_json(event.target),
     "current target:",
     normalize_for_json(event.target),
   ]);
   return true;
 }
 
-/**
- * controller.js in mozmill actually has its own extension mechanism,
- *  controllerAdditions.  Unfortunately, it does not make its stuff public at
- *  this time.  In the future we can change ourselves to just use that
- *  mechanism.
- */
 function augment_controller(aController, aWindowType) {
   if (aWindowType === undefined) {
     aWindowType = getWindowTypeOrId(
       aController.window.document.documentElement
     );
   }
 
   _augment_helper(aController, AugmentEverybodyWith);
--- a/mail/test/browser/shared-modules/controller.jsm
+++ b/mail/test/browser/shared-modules/controller.jsm
@@ -351,30 +351,16 @@ var MozMillController = function(window)
     function() {
       return window != null && this.isLoaded();
     },
     "controller(): Window could not be initialized.",
     undefined,
     undefined,
     this
   );
-
-  if (
-    controllerAdditions[
-      window.document.documentElement.getAttribute("windowtype")
-    ] != undefined
-  ) {
-    this.prototype = new utils.Copy(this.prototype);
-    controllerAdditions[
-      window.document.documentElement.getAttribute("windowtype")
-    ](this);
-    this.windowtype = window.document.documentElement.getAttribute(
-      "windowtype"
-    );
-  }
 };
 
 MozMillController.prototype.sleep = utils.sleep;
 
 /**
  * Synthesize a keypress event on the given element
  *
  * @param {ElemBase} aTarget
@@ -1501,53 +1487,8 @@ Tabs.prototype.__defineGetter__("length"
   return this.controller.window.gBrowser.browsers.length;
 });
 Tabs.prototype.__defineGetter__("activeTabIndex", function() {
   return this.controller.window.gBrowser.tabContainer.selectedIndex;
 });
 Tabs.prototype.selectTabIndex = function(i) {
   this.controller.window.gBrowser.selectTabAtIndex(i);
 };
-
-function browserAdditions(controller) {
-  controller.tabs = new Tabs(controller);
-
-  controller.waitForPageLoad = function(aDocument, aTimeout, aInterval) {
-    var timeout = aTimeout || 30000;
-    var win = null;
-
-    // If a user tries to do waitForPageLoad(2000), this will assign the
-    // interval the first arg which is most likely what they were expecting
-    if (typeof aDocument === "number") {
-      timeout = aDocument;
-    }
-
-    // If we have a real document use its default view
-    if (
-      aDocument &&
-      typeof aDocument === "object" &&
-      "defaultView" in aDocument
-    ) {
-      win = aDocument.defaultView;
-    }
-
-    // If no document has been specified, fallback to the default view of the
-    // currently selected tab browser
-    win = win || this.window.gBrowser.selectedBrowser.contentWindow;
-
-    // Wait until the content in the tab has been loaded
-    this.waitFor(
-      function() {
-        return this.isLoaded(win);
-      },
-      "controller.waitForPageLoad(): Timeout waiting for page loaded.",
-      timeout,
-      aInterval,
-      this
-    );
-
-    frame.events.pass({ function: "controller.waitForPageLoad()" });
-  };
-}
-
-var controllerAdditions = {
-  "navigator:browser": browserAdditions,
-};