зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1334572 - Dispatch WindowLowered/Raised events asynchronously in test mode (for marionette) (r=smaug)
MozReview-Commit-ID: Kwgl6sX4OoU
This commit is contained in:
Родитель
c8c4ea2401
Коммит
ed66ab4b53
|
@ -2204,10 +2204,18 @@ nsFocusManager::RaiseWindow(nsPIDOMWindowOuter* aWindow)
|
|||
|
||||
if (sTestMode) {
|
||||
// In test mode, emulate the existing window being lowered and the new
|
||||
// window being raised.
|
||||
if (mActiveWindow)
|
||||
WindowLowered(mActiveWindow);
|
||||
WindowRaised(aWindow);
|
||||
// window being raised. This happens in a separate runnable to avoid
|
||||
// touching multiple windows in the current runnable.
|
||||
nsCOMPtr<nsPIDOMWindowOuter> active(mActiveWindow);
|
||||
nsCOMPtr<nsPIDOMWindowOuter> window(aWindow);
|
||||
RefPtr<nsFocusManager> self(this);
|
||||
NS_DispatchToCurrentThread(
|
||||
NS_NewRunnableFunction([self, active, window] () -> void {
|
||||
if (active) {
|
||||
self->WindowLowered(active);
|
||||
}
|
||||
self->WindowRaised(window);
|
||||
}));
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче