Bug 810642 - Intermittent browser_dbg_panesize.js | Height preferences shouldn't have been updated yet, r=past
authorVictor Porof <vporof@mozilla.com>
Mon, 12 Nov 2012 16:14:09 +0200
changeset 112991 56f2416266047524b1433fb651f5205662149924
parent 112990 71274e4740604a00e916f9b28edd31e314c0b005
child 112992 104e49ae05f4a4fe48b33dec1b86d1a96a7c480b
push id23847
push userphilringnalda@gmail.com
push dateTue, 13 Nov 2012 05:07:25 +0000
treeherdermozilla-central@1b0226622e94 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspast
bugs810642
milestone19.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 810642 - Intermittent browser_dbg_panesize.js | Height preferences shouldn't have been updated yet, r=past
browser/devtools/debugger/test/browser_dbg_panesize-inner.js
browser/devtools/debugger/test/browser_dbg_panesize.js
--- a/browser/devtools/debugger/test/browser_dbg_panesize-inner.js
+++ b/browser/devtools/debugger/test/browser_dbg_panesize-inner.js
@@ -7,20 +7,32 @@
 function test() {
   var tab1 = addTab(TAB1_URL, function() {
     gBrowser.selectedTab = tab1;
 
     ok(!DebuggerUI.getDebugger(),
       "Shouldn't have a debugger pane for this tab yet.");
 
     let pane = DebuggerUI.toggleDebugger();
-    let someWidth1 = parseInt(Math.random() * 200) + 100;
-    let someWidth2 = parseInt(Math.random() * 200) + 100;
+    ok(pane, "toggleDebugger() should return a pane.");
+
+    let preferredSfw = Services.prefs.getIntPref("devtools.debugger.ui.stackframes-width");
+    let preferredBpw = Services.prefs.getIntPref("devtools.debugger.ui.variables-width");
+    let someWidth1, someWidth2;
 
-    ok(pane, "toggleDebugger() should return a pane.");
+    do {
+      someWidth1 = parseInt(Math.random() * 200) + 100;
+      someWidth2 = parseInt(Math.random() * 200) + 100;
+    } while (someWidth1 == preferredSfw ||
+             someWidth2 == preferredBpw)
+
+    info("Preferred stackframes width: " + preferredSfw);
+    info("Preferred variables width: " + preferredBpw);
+    info("Generated stackframes width: " + someWidth1);
+    info("Generated variables width: " + someWidth2);
 
     is(DebuggerUI.getDebugger(), pane,
       "getDebugger() should return the same pane as toggleDebugger().");
 
     let content = pane.contentWindow;
     let stackframes;
     let variables;
 
--- a/browser/devtools/debugger/test/browser_dbg_panesize.js
+++ b/browser/devtools/debugger/test/browser_dbg_panesize.js
@@ -7,30 +7,39 @@
 function test() {
   var tab1 = addTab(TAB1_URL, function() {
     gBrowser.selectedTab = tab1;
 
     ok(!DebuggerUI.getDebugger(),
       "Shouldn't have a debugger pane for this tab yet.");
 
     let pane = DebuggerUI.toggleDebugger();
-    let someHeight = parseInt(Math.random() * 200) + 200;
+    ok(pane, "toggleDebugger() should return a pane.");
+
+    let preferredHeight = Services.prefs.getIntPref("devtools.debugger.ui.height");
+    let someHeight;
 
-    ok(pane, "toggleDebugger() should return a pane.");
+    do {
+      someHeight = parseInt(Math.random() * 200) + 200;
+    } while (someHeight == preferredHeight)
+
+    info("Preferred pane height: " + preferredHeight);
+    info("Generated pane height: " + someHeight);
 
     is(DebuggerUI.getDebugger(), pane,
       "getDebugger() should return the same pane as toggleDebugger().");
 
     ok(DebuggerUI.preferences.height,
       "The debugger preferences should have a saved height value.");
 
     is(DebuggerUI.preferences.height, pane._frame.height,
       "The debugger pane height should be the same as the preferred value.");
 
     pane._frame.height = someHeight;
+
     ok(DebuggerUI.preferences.height !== someHeight,
       "Height preferences shouldn't have been updated yet.");
 
     wait_for_connect_and_resume(function() {
       removeTab(tab1);
     });
 
     window.addEventListener("Debugger:Shutdown", function dbgShutdown() {