Bug 1558298: Part 6 - Remove some arrant nonsense from ChromePowers.js. r=nika
authorKris Maglione <maglione.k@gmail.com>
Mon, 10 Jun 2019 14:57:58 -0700
changeset 544100 edd1cc6badf788f950ee68168aed0a14aa191411
parent 544099 ba24251835fbbd7348e96b7f2956f32811d3577e
child 544101 0e91fc9541c294b8c3133aae81f45d0bcab8155c
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);
 }