Bug 1061695 - Fix switching to simulator after local. r=paul
authorJ. Ryan Stinnett <jryans@gmail.com>
Tue, 02 Sep 2014 07:48:00 +0200
changeset 203244 4567aa2ed95bbe6634cabd8d170e2c283206c4e2
parent 203243 b37bfa44405ebff9f22533974faa2e8b60892344
child 203245 4243b005e874b97b5b0295166447b2dbf33fefcf
push id27424
push userryanvm@gmail.com
push dateWed, 03 Sep 2014 19:35:53 +0000
treeherdermozilla-central@bfef88becbba [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspaul
bugs1061695
milestone35.0a1
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
Bug 1061695 - Fix switching to simulator after local. r=paul
browser/devtools/webide/modules/runtimes.js
--- a/browser/devtools/webide/modules/runtimes.js
+++ b/browser/devtools/webide/modules/runtimes.js
@@ -84,16 +84,17 @@ function SimulatorRuntime(version) {
 SimulatorRuntime.prototype = {
   connect: function(connection) {
     let port = ConnectionManager.getFreeTCPPort();
     let simulator = Simulator.getByVersion(this.version);
     if (!simulator || !simulator.launch) {
       return promise.reject("Can't find simulator: " + this.getName());
     }
     return simulator.launch({port: port}).then(() => {
+      connection.host = "localhost";
       connection.port = port;
       connection.keepConnecting = true;
       connection.once(Connection.Events.DISCONNECTED, simulator.close);
       connection.connect();
     });
   },
   getID: function() {
     return this.version;
@@ -104,18 +105,18 @@ SimulatorRuntime.prototype = {
 }
 
 let gLocalRuntime = {
   connect: function(connection) {
     if (!DebuggerServer.initialized) {
       DebuggerServer.init();
       DebuggerServer.addBrowserActors();
     }
+    connection.host = null; // Force Pipe transport
     connection.port = null;
-    connection.host = null; // Force Pipe transport
     connection.connect();
     return promise.resolve();
   },
   getName: function() {
     return Strings.GetStringFromName("local_runtime");
   },
 }