From ddd3e9f4f593e04be67601683fc4c0a4c847e3a8 Mon Sep 17 00:00:00 2001 From: Daniel Varga Date: Mon, 22 Jul 2019 12:52:29 +0300 Subject: [PATCH] Backed out changeset 0eaeadceac47 (bug 1563040) requested by whimboo --- testing/marionette/browser.js | 6 +++++- .../marionette_harness/runner/mixins/window_manager.py | 5 ++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/testing/marionette/browser.js b/testing/marionette/browser.js index dead62df27a2..924731ae73d9 100644 --- a/testing/marionette/browser.js +++ b/testing/marionette/browser.js @@ -353,7 +353,11 @@ browser.Context = class { subject => subject == win ); - win.focus(); + // Bug 1509380 - Missing focus/activate event when Firefox is not + // the top-most application. As such wait for the next tick, and + // manually focus the newly opened window. + win.setTimeout(() => win.focus(), 0); + await Promise.all([activated, focused, startup]); // The new window shouldn't get focused. As such set the diff --git a/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py b/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py index e98eddae91b1..79f702ebc258 100644 --- a/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py +++ b/testing/marionette/harness/marionette_harness/runner/mixins/window_manager.py @@ -163,7 +163,10 @@ class WindowManagerMixin(object): let win = window.openDialog(url, null, "chrome,centerscreen"); let focused = waitForFocus(win); - win.focus(); + // Bug 1509380 - Missing focus/activate event when Firefox is not + // the top-most application. As such wait for the next tick, and + // manually focus the newly opened window. + win.setTimeout(() => win.focus(), 0); await focused; // The new window shouldn't get focused. As such set the