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 259048 730ee363037de9785e74ebaba7684dd17f2aadf9
parent 259047 e9b9b384ff3fda1b472b162bf19e2c770510d95a
child 259049 eeb15bcbb0f4a0595e12f7e533153105403849b9
push id4716
push userryanvm@gmail.com
push dateMon, 04 May 2015 17:29:25 +0000
treeherdermozilla-beta@b91226cec861 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjanx, sledru
bugs1159083
milestone38.0
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),