Bug 1159083 - Pass XAUTHORITY to Linux simulators. r=janx, a=sledru
authorJ. Ryan Stinnett <jryans@gmail.com>
Thu, 30 Apr 2015 15:37:05 -0700
changeset 267308 decc405cf39875d307f3f66f8e89b38e5ed0b894
parent 267307 c5132b63860c15b94f8fe3f5ba657293b4fbe97f
child 267309 03c37cb5965b34bab781a25fa93d4c825ac13331
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanx, sledru
bugs1159083
milestone39.0a2
Bug 1159083 - Pass XAUTHORITY to Linux simulators. r=janx, a=sledru
browser/devtools/webide/modules/simulator-process.js
--- a/browser/devtools/webide/modules/simulator-process.js
+++ b/browser/devtools/webide/modules/simulator-process.js
@@ -60,19 +60,21 @@ SimulatorProcess.prototype = {
     });
 
     this.on("stdout", (e, data) => this.log(e, data.trim()));
     this.on("stderr", (e, data) => this.log(e, data.trim()));
 
     let environment;
     if (OS.indexOf("linux") > -1) {
       environment = ["TMPDIR=" + Services.dirsvc.get("TmpD", Ci.nsIFile).path];
-      if ("DISPLAY" in Environment) {
-        environment.push("DISPLAY=" + Environment.DISPLAY);
-      }
+      ["DISPLAY", "XAUTHORITY"].forEach(key => {
+        if (key in Environment) {
+          environment.push(key + "=" + Environment[key]);
+        }
+      });
     }
 
     // Spawn a B2G instance.
     this.process = Subprocess.call({
       command: b2g,
       arguments: this.args,
       environment: environment,
       stdout: data => this.emit("stdout", data),