зеркало из https://github.com/mozilla/pjs.git
Bug 703230 - Remove mochitest waitForFocus() debug output. r=jmaher
This commit is contained in:
Родитель
4a6ff3b604
Коммит
27973fdbb6
|
@ -499,21 +499,7 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
|
||||||
return SpecialPowers.getPrivilegedProps(aWindow, 'location.href');
|
return SpecialPowers.getPrivilegedProps(aWindow, 'location.href');
|
||||||
}
|
}
|
||||||
|
|
||||||
function debugFocusLog(prefix) {
|
|
||||||
info(prefix + " -- loaded: " + targetWindow.document.readyState +
|
|
||||||
" active window: " +
|
|
||||||
(SpecialPowers.activeWindow() ? "(" + SpecialPowers.activeWindow() + ") " + getHref(SpecialPowers.activeWindow()) : "<no window active>") +
|
|
||||||
" focused window: " +
|
|
||||||
(SpecialPowers.focusedWindow() ? "(" + SpecialPowers.focusedWindow() + ") " + getHref(SpecialPowers.focusedWindow()) : "<no window focused>") +
|
|
||||||
" desired window: (" + targetWindow + ") " + getHref(targetWindow) +
|
|
||||||
" child window: (" + childTargetWindow + ") " + getHref(childTargetWindow));
|
|
||||||
}
|
|
||||||
|
|
||||||
debugFocusLog("before wait for focus");
|
|
||||||
|
|
||||||
function maybeRunTests() {
|
function maybeRunTests() {
|
||||||
debugFocusLog("maybe run tests <load:" +
|
|
||||||
SimpleTest.waitForFocus_loaded + ", focus:" + SimpleTest.waitForFocus_focused + ">");
|
|
||||||
if (SimpleTest.waitForFocus_loaded &&
|
if (SimpleTest.waitForFocus_loaded &&
|
||||||
SimpleTest.waitForFocus_focused &&
|
SimpleTest.waitForFocus_focused &&
|
||||||
!SimpleTest.waitForFocus_started) {
|
!SimpleTest.waitForFocus_started) {
|
||||||
|
@ -524,8 +510,6 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
|
||||||
|
|
||||||
function waitForEvent(event) {
|
function waitForEvent(event) {
|
||||||
try {
|
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
|
// Check to make sure that this isn't a load event for a blank or
|
||||||
// non-blank page that wasn't desired.
|
// non-blank page that wasn't desired.
|
||||||
if (event.type == "load" && (expectBlankPage != (event.target.location == "about:blank")))
|
if (event.type == "load" && (expectBlankPage != (event.target.location == "about:blank")))
|
||||||
|
@ -564,7 +548,6 @@ SimpleTest.waitForFocus = function (callback, targetWindow, expectBlankPage) {
|
||||||
// If this is a child frame, ensure that the frame is focused.
|
// If this is a child frame, ensure that the frame is focused.
|
||||||
SimpleTest.waitForFocus_focused = (focusedChildWindow == childTargetWindow);
|
SimpleTest.waitForFocus_focused = (focusedChildWindow == childTargetWindow);
|
||||||
if (SimpleTest.waitForFocus_focused) {
|
if (SimpleTest.waitForFocus_focused) {
|
||||||
info("already focused");
|
|
||||||
// If the frame is already focused and loaded, call the callback directly.
|
// If the frame is already focused and loaded, call the callback directly.
|
||||||
maybeRunTests();
|
maybeRunTests();
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче