Bug 486502 - Dispatch test events only when running mochitest/chrome/browser-chrome, r+sr=roc

This commit is contained in:
Olli Pettay 2009-05-06 07:30:39 +03:00
Родитель 186f3fc8f1
Коммит d9e11a8bce
2 изменённых файлов: 19 добавлений и 12 удалений

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

@ -246,6 +246,7 @@ user_pref("browser.EULA.override", true);
user_pref("javascript.options.jit.content", true);
user_pref("gfx.color_management.force_srgb", true);
user_pref("network.manage-offline-status", false);
user_pref("test.mousescroll", true);
user_pref("security.default_personal_cert", "Select Automatically"); // Need to client auth test be w/o any dialogs
user_pref("network.http.prompt-temp-redirect", false);
user_pref("svg.smil.enabled", true); // Needed for SMIL mochitests until bug 482402 lands

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

@ -609,12 +609,15 @@ void
nsMouseWheelTransaction::OnFailToScrollTarget()
{
NS_PRECONDITION(sTargetFrame, "We don't have mouse scrolling transaction");
// This event is used for automated tests, see bug 442774.
nsContentUtils::DispatchTrustedEvent(
sTargetFrame->GetContent()->GetOwnerDoc(),
sTargetFrame->GetContent(),
NS_LITERAL_STRING("MozMouseScrollFailed"),
PR_TRUE, PR_TRUE);
if (nsContentUtils::GetBoolPref("test.mousescroll", PR_FALSE)) {
// This event is used for automated tests, see bug 442774.
nsContentUtils::DispatchTrustedEvent(
sTargetFrame->GetContent()->GetOwnerDoc(),
sTargetFrame->GetContent(),
NS_LITERAL_STRING("MozMouseScrollFailed"),
PR_TRUE, PR_TRUE);
}
// The target frame might be destroyed in the event handler, at that time,
// we need to finish the current transaction
if (!sTargetFrame)
@ -634,12 +637,15 @@ nsMouseWheelTransaction::OnTimeout(nsITimer* aTimer, void* aClosure)
// We need to finish current transaction before DOM event firing. Because
// the next DOM event might create strange situation for us.
EndTransaction();
// This event is used for automated tests, see bug 442774.
nsContentUtils::DispatchTrustedEvent(
frame->GetContent()->GetOwnerDoc(),
frame->GetContent(),
NS_LITERAL_STRING("MozMouseScrollTransactionTimeout"),
PR_TRUE, PR_TRUE);
if (nsContentUtils::GetBoolPref("test.mousescroll", PR_FALSE)) {
// This event is used for automated tests, see bug 442774.
nsContentUtils::DispatchTrustedEvent(
frame->GetContent()->GetOwnerDoc(),
frame->GetContent(),
NS_LITERAL_STRING("MozMouseScrollTransactionTimeout"),
PR_TRUE, PR_TRUE);
}
}
void