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,15 +298,22 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
}
function waitForEvent(event) {
// 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")))
return;
try {
debugFocusLog("waitForEvent called <type:" + event.type + ", target" + event.target + ">");
SimpleTest["waitForFocus_" + event.type + "ed"] = true;
var win = (event.type == "load") ? targetWindow : childTargetWindow;
win.removeEventListener(event.type, waitForEvent, true);
maybeRunTests();
// 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")))
return;
SimpleTest["waitForFocus_" + event.type + "ed"] = true;
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