Backed out changeset b166a3cda8f6 (bug 1121577) for B2G cpptest startup crashes.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 22 Jan 2015 20:58:36 -0500
changeset 238623 6b29617a738f7722f8ac9a58826c9b467da00115
parent 238622 e5edf734c837b09308732b174dab7bb234eb138d
child 238624 548b175be3673d5bb2bf1b0dc743f3fb147ceeb4
push id478
push usercliu@mozilla.com
push dateFri, 23 Jan 2015 19:38:17 +0000
bugs1121577
milestone38.0a1
backs outb166a3cda8f61fea2154a7ad46670e6c4d22fc16
Backed out changeset b166a3cda8f6 (bug 1121577) for B2G cpptest startup crashes. CLOSED TREE
testing/marionette/marionette-server.js
--- a/testing/marionette/marionette-server.js
+++ b/testing/marionette/marionette-server.js
@@ -20,16 +20,19 @@ 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");
@@ -48,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");
@@ -156,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,
@@ -578,26 +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);
-    }
-
     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);
       this.setSessionCapabilities(aRequest.parameters.capabilities);
     }
 
     function waitForWindow() {