Bug 1558298: Part 6 - Remove some arrant nonsense from ChromePowers.js. r=nika
☠☠ backed out by f9bf5e4b0b4f ☠ ☠
authorKris Maglione <maglione.k@gmail.com>
Mon, 10 Jun 2019 14:57:58 -0700
changeset 543717 162bc1fc273035ca47ad28947f6b339d2101c29b
parent 543716 f94500dd11e38ba34310216d958943d6ef07ce96
child 543718 d27574cfbb0ed580612d7f468f804aa7819fed21
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnika
bugs1558298
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 1558298: Part 6 - Remove some arrant nonsense from ChromePowers.js. r=nika Differential Revision: https://phabricator.services.mozilla.com/D34595
testing/mochitest/tests/SimpleTest/ChromePowers.js
--- a/testing/mochitest/tests/SimpleTest/ChromePowers.js
+++ b/testing/mochitest/tests/SimpleTest/ChromePowers.js
@@ -4,22 +4,17 @@
 
 ChromeUtils.import("resource://specialpowers/SpecialPowersAPI.jsm", this);
 
 function ChromePowers(window) {
   this.window = Cu.getWeakReference(window);
 
   this.chromeWindow = window;
 
-  if (typeof(window) == "ChromeWindow" && typeof(content.window) == "Window") {
-    this.DOMWindowUtils = bindDOMWindowUtils(content.window);
-    this.window = Cu.getWeakReference(content.window);
-  } else {
-    this.DOMWindowUtils = bindDOMWindowUtils(window);
-  }
+  this.DOMWindowUtils = bindDOMWindowUtils(window);
 
   this.spObserver = new SpecialPowersObserverAPI();
   this.spObserver._sendReply = this._sendReply.bind(this);
   this.listeners = new Map();
 }
 
 ChromePowers.prototype = new SpecialPowersAPI();
 
@@ -101,20 +96,17 @@ ChromePowers.prototype.focus = function(
   if (aWindow)
     aWindow.focus();
 };
 
 ChromePowers.prototype.executeAfterFlushingMessageQueue = function(aCallback) {
   aCallback();
 };
 
-if ((window.parent !== null) &&
-    (window.parent !== undefined) &&
-    (window.parent.wrappedJSObject.SpecialPowers) &&
-    !(window.wrappedJSObject.SpecialPowers)) {
-  window.wrappedJSObject.SpecialPowers = window.parent.SpecialPowers;
+if (window.parent.SpecialPowers && !window.SpecialPowers) {
+  window.SpecialPowers = window.parent.SpecialPowers;
 } else {
   const {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");
   Services.scriptloader.loadSubScript("resource://specialpowers/SpecialPowersObserverAPI.js", this);
 
-  window.wrappedJSObject.SpecialPowers = new ChromePowers(window);
+  window.SpecialPowers = new ChromePowers(window);
 }