From 324dcc6b5adac99e207e6e562cae4fcb70acf3b8 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Tue, 10 Feb 2015 15:09:52 -0800 Subject: [PATCH] Backed out changeset 91c1bd885ad9 (bug 1121577) for Gip failures on a CLOSED TREE --- .../marionette/marionette-frame-manager.js | 7 ++--- testing/marionette/marionette-server.js | 26 +++++-------------- .../content/SpecialPowersObserverAPI.js | 8 +++--- 3 files changed, 12 insertions(+), 29 deletions(-) diff --git a/testing/marionette/marionette-frame-manager.js b/testing/marionette/marionette-frame-manager.js index f0be626d02f..8243e92b7a1 100644 --- a/testing/marionette/marionette-frame-manager.js +++ b/testing/marionette/marionette-frame-manager.js @@ -16,6 +16,8 @@ let logger = Log.repository.getLogger("Marionette"); let loader = Cc["@mozilla.org/moz/jssubscript-loader;1"] .getService(Ci.mozIJSSubScriptLoader); let specialpowers = {}; +loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.js", + specialpowers); //list of OOP frames that has the frame script loaded let remoteFrames = []; @@ -106,11 +108,6 @@ FrameManager.prototype = { let oopFrame = frameWindow.document.getElementsByTagName("iframe")[message.json.frame]; //find the OOP frame let mm = oopFrame.QueryInterface(Ci.nsIFrameLoaderOwner).frameLoader.messageManager; //get the OOP frame's mm - if (!specialpowers.hasOwnProperty("specialPowersObserver")) { - loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.js", - specialpowers); - } - // See if this frame already has our frame script loaded in it; if so, // just wake it up. for (let i = 0; i < remoteFrames.length; i++) { diff --git a/testing/marionette/marionette-server.js b/testing/marionette/marionette-server.js index a4e3d0db177..24a177d1276 100644 --- a/testing/marionette/marionette-server.js +++ b/testing/marionette/marionette-server.js @@ -25,7 +25,14 @@ loader.loadSubScript("chrome://marionette/content/ChromeUtils.js", utils); loader.loadSubScript("chrome://marionette/content/atoms.js", utils); loader.loadSubScript("chrome://marionette/content/marionette-sendkeys.js", utils); +// SpecialPowers requires insecure automation-only features that we put behind a pref. +Services.prefs.setBoolPref('security.turn_off_all_security_so_that_viruses_can_take_over_this_computer', + true); let specialpowers = {}; +loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.js", + specialpowers); +specialpowers.specialPowersObserver = new specialpowers.SpecialPowersObserver(); +specialpowers.specialPowersObserver.init(); Cu.import("resource://gre/modules/FileUtils.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm"); @@ -49,7 +56,6 @@ loader.loadSubScript("resource://gre/modules/devtools/transport/transport.js"); let bypassOffline = false; let qemu = "0"; let device = null; -const SECURITY_PREF = 'security.turn_off_all_security_so_that_viruses_can_take_over_this_computer'; XPCOMUtils.defineLazyServiceGetter(this, "cookieManager", "@mozilla.org/cookiemanager;1", @@ -157,7 +163,6 @@ function MarionetteServerConnection(aPrefix, aTransport, aServer) this.currentFrameElement = null; this.testName = null; this.mozBrowserClose = null; - this.enabled_security_pref = false; this.sandbox = null; this.oopFrameId = null; // frame ID of current remote frame, used for mozbrowserclose events this.sessionCapabilities = { @@ -579,23 +584,6 @@ MarionetteServerConnection.prototype = { this.command_id = this.getCommandId(); this.newSessionCommandId = this.command_id; - // SpecialPowers requires insecure automation-only features that we put behind a pref - let security_pref_value = false; - try { - security_pref_value = Services.prefs.getBoolPref(SECURITY_PREF); - } catch(e) {} - if (!security_pref_value) { - this.enabled_security_pref = true; - Services.prefs.setBoolPref(SECURITY_PREF, true); - } - - if (!specialpowers.hasOwnProperty('specialPowersObserver')) { - loader.loadSubScript("chrome://specialpowers/content/SpecialPowersObserver.js", - specialpowers); - specialpowers.specialPowersObserver = new specialpowers.SpecialPowersObserver(); - specialpowers.specialPowersObserver.init(); - } - this.scriptTimeout = 10000; if (aRequest && aRequest.parameters) { this.sessionId = aRequest.parameters.session_id ? aRequest.parameters.session_id : null; diff --git a/testing/specialpowers/content/SpecialPowersObserverAPI.js b/testing/specialpowers/content/SpecialPowersObserverAPI.js index f084552aa45..8744f0912d8 100644 --- a/testing/specialpowers/content/SpecialPowersObserverAPI.js +++ b/testing/specialpowers/content/SpecialPowersObserverAPI.js @@ -16,15 +16,13 @@ if (typeof(Cc) == 'undefined') { /** * Special Powers Exception - used to throw exceptions nicely **/ -this.SpecialPowersException = function SpecialPowersException(aMsg) { +function SpecialPowersException(aMsg) { this.message = aMsg; this.name = "SpecialPowersException"; } -SpecialPowersException.prototype = { - toString: function SPE_toString() { - return this.name + ': "' + this.message + '"'; - } +SpecialPowersException.prototype.toString = function() { + return this.name + ': "' + this.message + '"'; }; this.SpecialPowersObserverAPI = function SpecialPowersObserverAPI() {