Bug 790553 - Increase the timeout when connecting to Firefox for Android from the Remote Debugger, r=past
authorVictor Porof <vporof@mozilla.com>
Mon, 01 Oct 2012 15:16:00 +0300
changeset 108911 0c8442db91feccee0add2a0173ef66c0e2ea47e2
parent 108910 59783c7c3040b0ca871930ffb77a5b49f317eb92
child 108912 a2214e8900c0820dbc66ff0bc7903a415e2101f8
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
reviewerspast
bugs790553
milestone18.0a1
Bug 790553 - Increase the timeout when connecting to Firefox for Android from the Remote Debugger, r=past
browser/app/profile/firefox.js
browser/devtools/debugger/test/browser_dbg_createRemote.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1024,17 +1024,17 @@ pref("devtools.layoutview.open", false);
 pref("devtools.responsiveUI.enabled", true);
 
 // Enable the Debugger
 pref("devtools.debugger.enabled", true);
 pref("devtools.debugger.chrome-enabled", false);
 pref("devtools.debugger.remote-host", "localhost");
 pref("devtools.debugger.remote-autoconnect", false);
 pref("devtools.debugger.remote-connection-retries", 3);
-pref("devtools.debugger.remote-timeout", 3000);
+pref("devtools.debugger.remote-timeout", 20000);
 
 // The default Debugger UI settings
 pref("devtools.debugger.ui.height", 250);
 pref("devtools.debugger.ui.remote-win.width", 900);
 pref("devtools.debugger.ui.remote-win.height", 400);
 pref("devtools.debugger.ui.stackframes-width", 200);
 pref("devtools.debugger.ui.stackframes-pane-visible", true);
 pref("devtools.debugger.ui.variables-width", 300);
--- a/browser/devtools/debugger/test/browser_dbg_createRemote.js
+++ b/browser/devtools/debugger/test/browser_dbg_createRemote.js
@@ -2,29 +2,35 @@
  * Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/
  */
 
 // Tests that a remote debugger can be created in a new window.
 
 var gWindow = null;
 var gTab = null;
+var gRemoteHost = null;
 var gRemotePort = null;
+var gRemoteTimeout = null;
 var gAutoConnect = null;
 
 const TEST_URL = EXAMPLE_URL + "browser_dbg_iframes.html";
 
 function test() {
   debug_remote(TEST_URL, function(aTab, aDebuggee, aWindow) {
     gTab = aTab;
     gWindow = aWindow;
     let gDebugger = gWindow.contentWindow;
 
+    info("Current remote host: " +
+      Services.prefs.getCharPref("devtools.debugger.remote-host"));
     info("Current remote port: " +
       Services.prefs.getIntPref("devtools.debugger.remote-port"));
+    info("Current remote timeout: " +
+      Services.prefs.getIntPref("devtools.debugger.remote-timeout"));
     info("Current autoconnect flag: " +
       Services.prefs.getBoolPref("devtools.debugger.remote-autoconnect"));
 
     is(gDebugger.document.getElementById("close").getAttribute("hidden"), "true",
       "The close button should be hidden in a remote debugger.");
 
     is(gDebugger.DebuggerController.activeThread.paused, false,
       "Should be running after debug_remote.");
@@ -61,28 +67,32 @@ function test() {
   },
   function beforeTabAdded() {
     if (!DebuggerServer.initialized) {
       DebuggerServer.init(function() { return true; });
       DebuggerServer.addBrowserActors();
     }
     DebuggerServer.closeListener();
 
+    gRemoteHost = Services.prefs.getCharPref("devtools.debugger.remote-host");
     gRemotePort = Services.prefs.getIntPref("devtools.debugger.remote-port");
+    gRemoteTimeout = Services.prefs.getIntPref("devtools.debugger.remote-timeout");
     gAutoConnect = Services.prefs.getBoolPref("devtools.debugger.remote-autoconnect");
 
     // Open the listener at some point in the future to test automatic reconnect.
-    openListener(gRemotePort + 1);
+    openListener(gRemoteHost, gRemotePort + 1, gRemoteTimeout / 10);
   });
 }
 
 let attempts = 0;
 
-function openListener(port) {
+function openListener(host, port, timeout) {
+  Services.prefs.setCharPref("devtools.debugger.remote-host", host);
   Services.prefs.setIntPref("devtools.debugger.remote-port", port);
+  Services.prefs.setIntPref("devtools.debugger.remote-timeout", timeout);
   Services.prefs.setBoolPref("devtools.debugger.remote-autoconnect", true);
 
   info("Attempting to open a new listener on port " + port);
   try {
     info("Closing listener...");
     DebuggerServer.closeListener();
     info("Opening listener...");
     DebuggerServer.openListener(port);
@@ -96,16 +106,20 @@ function openListener(port) {
       openListener(port);
     } else {
       ok(false, "Timed out while opening a listener.");
     }
   }
 }
 
 registerCleanupFunction(function() {
+  Services.prefs.setCharPref("devtools.debugger.remote-host", gRemoteHost);
   Services.prefs.setIntPref("devtools.debugger.remote-port", gRemotePort);
+  Services.prefs.setIntPref("devtools.debugger.remote-timeout", gRemoteTimeout);
   Services.prefs.setBoolPref("devtools.debugger.remote-autoconnect", gAutoConnect);
   removeTab(gTab);
   gWindow = null;
   gTab = null;
+  gRemoteHost = null;
   gRemotePort = null;
+  gRemoteTimeout = null;
   gAutoConnect = null;
 });