Backed out changeset 91c1bd885ad9 (bug 1121577) for Gip failures on a CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Tue, 10 Feb 2015 15:09:52 -0800
changeset 255661 18ae6f259c06e373218bafb532b68c019777c055
parent 255660 e3b66bc377064b06a8484b04270778b210638e0e
child 255662 079a6f0578b9d43973817764324784a8a8172639
push id4610
push userjlund@mozilla.com
push dateMon, 30 Mar 2015 18:32:55 +0000
treeherdermozilla-beta@4df54044d9ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1121577
milestone38.0a1
backs out91c1bd885ad98929c0eda0f22ed516e84f504322
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
Backed out changeset 91c1bd885ad9 (bug 1121577) for Gip failures on a CLOSED TREE
testing/marionette/marionette-frame-manager.js
testing/marionette/marionette-server.js
testing/specialpowers/content/SpecialPowersObserverAPI.js
--- a/testing/marionette/marionette-frame-manager.js
+++ b/testing/marionette/marionette-frame-manager.js
@@ -11,16 +11,18 @@ Cu.import("resource://gre/modules/Servic
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
 
 Cu.import("resource://gre/modules/Log.jsm");
 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 = [];
 
 /**
  * An object representing a frame that Marionette has loaded a
  * frame script in.
  */
@@ -101,21 +103,16 @@ FrameManager.prototype = {
 
   //This is just 'switch to OOP frame'. We're handling this here so we can maintain a list of remoteFrames.
   switchToFrame: function FM_switchToFrame(message) {
     // Switch to a remote frame.
     let frameWindow = Services.wm.getOuterWindowWithId(message.json.win); //get the original frame window
     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++) {
       let frame = remoteFrames[i];
       let frameMessageManager = frame.messageManager.get();
       logger.info("trying remote frame " + i);
       try {
         frameMessageManager.sendAsyncMessage("aliveCheck", {});
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -20,17 +20,24 @@ Cu.import("resource://gre/modules/Servic
 loader.loadSubScript("chrome://marionette/content/marionette-frame-manager.js");
 Cu.import("chrome://marionette/content/marionette-elements.js");
 let utils = {};
 loader.loadSubScript("chrome://marionette/content/EventUtils.js", utils);
 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");
 
 function isMulet() {
   let isMulet = false;
   try {
    isMulet = Services.prefs.getBoolPref("b2g.is_mulet");
@@ -44,17 +51,16 @@ let appName = isMulet() ? "B2G" : Servic
 let { devtools } = Cu.import("resource://gre/modules/devtools/Loader.jsm", {});
 let DevToolsUtils = devtools.require("devtools/toolkit/DevToolsUtils.js");
 this.DevToolsUtils = DevToolsUtils;
 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",
                                    "nsICookieManager");
 
 try {
   XPCOMUtils.defineLazyGetter(this, "libcutils", function () {
     Cu.import("resource://gre/modules/systemlibs.js");
@@ -152,17 +158,16 @@ function MarionetteServerConnection(aPre
   this.mainFrame = null; //topmost chrome frame
   this.curFrame = null; // chrome iframe that currently has focus
   this.mainContentFrameId = null;
   this.importedScripts = FileUtils.getFile('TmpD', ['marionetteChromeScripts']);
   this.importedScriptHashes = {"chrome" : [], "content": []};
   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 = {
     // Mandated capabilities
     "browserName": appName,
     "browserVersion": Services.appinfo.version,
     "platformName": Services.appinfo.OS.toUpperCase(),
     "platformVersion": Services.appinfo.platformVersion,
@@ -574,33 +579,16 @@ MarionetteServerConnection.prototype = {
    * as part of the Marionette:register IPC command in the
    * receiveMessage callback when a new browser is created.
    */
   newSession: function MDA_newSession(aRequest) {
     logger.info("The newSession request is " + JSON.stringify(aRequest))
     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;
       logger.info("Session Id is set to: " + this.sessionId);
       try {
         this.setSessionCapabilities(aRequest.parameters.capabilities);
       } catch (e) {
         // 71 error is "session not created"
--- a/testing/specialpowers/content/SpecialPowersObserverAPI.js
+++ b/testing/specialpowers/content/SpecialPowersObserverAPI.js
@@ -11,25 +11,23 @@ if (typeof(Ci) == 'undefined') {
 
 if (typeof(Cc) == 'undefined') {
   var Cc = Components.classes;
 }
 
 /**
  * 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() {
   this._crashDumpDir = null;
   this._processCrashObserversRegistered = false;
   this._chromeScriptListeners = [];
 }