B2G/gecko/testing/mochitest/tests/SimpleTest/ChromePowers.js
/* 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/. */
This Source Code Form is subject to the terms of the Mozilla Public
License, v.
This Source Code Form is subject to the terms of the Mozilla Public License v .
function ChromePowers(window) {
  this.window = Components.utils.getWeakReference(window);
  if (typeof(window) == "ChromeWindow" && typeof(content.window) == "Window") {
    this.DOMWindowUtils = bindDOMWindowUtils(content.window);
    this.window = Components.utils.getWeakReference(content.window);
  } else {
    this.DOMWindowUtils = bindDOMWindowUtils(window);
  }
  this.spObserver = new SpecialPowersObserverAPI();
}
function ChromePowers ( window ) { this . window = Components . utils . getWeakReference ( window ) ; if ( typeof ( window ) == "ChromeWindow" && typeof ( content . window ) == "Window" ) { this . DOMWindowUtils = bindDOMWindowUtils ( content . window ) ; this . window = Components . utils . getWeakReference ( content . window ) ; } else { this . DOMWindowUtils = bindDOMWindowUtils ( window ) ; } this . spObserver = new SpecialPowersObserverAPI ( ) ; }
This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0.
This Source Code Form is subject to the terms of the Mozilla Public License v . 2 . 0 .
// In the case of browser-chrome tests, we are running as a [ChromeWindow] // and we have no window.QueryInterface available, content.window is what we need