Bug 778597 - Intermittent browser_webconsole_position_ui.js | Timed out while waiting for: web console position changed to 'window'; r=rcampbell

This commit is contained in:
Mihai Sucan 2012-08-01 21:32:38 +03:00
Родитель b68928dfd0
Коммит 6d09b2c201
2 изменённых файлов: 20 добавлений и 15 удалений

Просмотреть файл

@ -611,7 +611,6 @@ WebConsole.prototype = {
let position = Services.prefs.getCharPref("devtools.webconsole.position");
this.positionConsole(position);
this._currentUIPosition = position;
},
/**
@ -622,8 +621,10 @@ WebConsole.prototype = {
{
this.iframe.removeEventListener("load", this._onIframeLoad, true);
let position = Services.prefs.getCharPref("devtools.webconsole.position");
this.iframeWindow = this.iframe.contentWindow.wrappedJSObject;
this.ui = new this.iframeWindow.WebConsoleFrame(this, this._currentUIPosition);
this.ui = new this.iframeWindow.WebConsoleFrame(this, position);
this._setupMessageManager();
},
@ -695,8 +696,6 @@ WebConsole.prototype = {
this.iframe.flex = 1;
panel.setAttribute("height", height);
this._afterPositionConsole("window", lastIndex);
}).bind(this);
panel.addEventListener("popupshown", onPopupShown,false);
@ -736,6 +735,9 @@ WebConsole.prototype = {
if (this.splitter.parentNode) {
this.splitter.parentNode.removeChild(this.splitter);
}
this._beforePositionConsole("window", lastIndex);
panel.appendChild(this.iframe);
let space = this.chromeDocument.createElement("spacer");
@ -822,6 +824,8 @@ WebConsole.prototype = {
this.splitter.parentNode.removeChild(this.splitter);
}
this._beforePositionConsole(aPosition, lastIndex);
if (aPosition == "below") {
nBox.appendChild(this.splitter);
nBox.appendChild(this.iframe);
@ -841,12 +845,10 @@ WebConsole.prototype = {
this.iframe.removeAttribute("height");
this.iframe.style.height = height + "px";
}
this._afterPositionConsole(aPosition, lastIndex);
},
/**
* Common code that needs to execute after the Web Console is repositioned.
* Common code that needs to execute before the Web Console is repositioned.
* @private
* @param string aPosition
* The new position: "above", "below" or "window".
@ -854,8 +856,8 @@ WebConsole.prototype = {
* The last visible message in the console output before repositioning
* occurred.
*/
_afterPositionConsole:
function WC__afterPositionConsole(aPosition, aLastIndex)
_beforePositionConsole:
function WC__beforePositionConsole(aPosition, aLastIndex)
{
if (!this.ui) {
return;

Просмотреть файл

@ -37,7 +37,7 @@ function waitForPosition(aPosition, aCallback) {
{
return hudRef._currentUIPosition == aPosition;
},
successFn: aCallback,
successFn: executeSoon.bind(null, aCallback),
failureFn: finishTest,
});
}
@ -55,9 +55,10 @@ function consoleOpened(aHudRef) {
"position menu checkbox is below");
is(Services.prefs.getCharPref(POSITION_PREF), "below", "pref is below");
hudRef.positionConsole("above");
waitForPosition("above", onPositionAbove);
executeSoon(function() {
hudRef.positionConsole("above");
waitForPosition("above", onPositionAbove);
});
}
function onPositionAbove() {
@ -81,8 +82,10 @@ function onPositionAbove() {
Services.prefs.setIntPref(TOP_PREF, 50);
Services.prefs.setIntPref(LEFT_PREF, 51);
hudRef.positionConsole("window");
waitForPosition("window", onPositionWindow);
executeSoon(function() {
hudRef.positionConsole("window");
waitForPosition("window", onPositionWindow);
});
}
function onPositionWindow() {