Bug 542928 - Add some more debugging logs to waitForFocus in order to track down the browser-chrome random orange; r=enndeakin

This commit is contained in:
Ehsan Akhgari 2010-05-19 09:52:07 -04:00
Родитель a63234bb3d
Коммит e9dbf69d65
1 изменённых файлов: 15 добавлений и 8 удалений

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

@ -298,6 +298,9 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
}
function waitForEvent(event) {
try {
debugFocusLog("waitForEvent called <type:" + event.type + ", target" + event.target + ">");
// Check to make sure that this isn't a load event for a blank or
// non-blank page that wasn't desired.
if (event.type == "load" && (expectBlankPage != (event.target.location == "about:blank")))
@ -307,6 +310,10 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
var win = (event.type == "load") ? targetWindow : childTargetWindow;
win.removeEventListener(event.type, waitForEvent, true);
maybeRunTests();
} catch (e) {
SimpleTest.ok(false, "Exception caught in waitForEvent: " + e.message +
", at: " + e.fileName + " (" + e.lineNumber + ")");
}
}
// If the current document is about:blank and we are not expecting a blank