Bug 1499082 - [marionette] Fix focus handling on Android for newly opened tab. r=ato
authorHenrik Skupin <mail@hskupin.info>
Thu, 14 Mar 2019 19:53:09 +0000
changeset 521964 d57870ac257d
parent 521963 1d23b016870a
child 521965 ee7dd744c695
push id10870
push usernbeleuzu@mozilla.com
push dateFri, 15 Mar 2019 20:00:07 +0000
treeherdermozilla-beta@c594aee5b7a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1499082
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1499082 - [marionette] Fix focus handling on Android for newly opened tab. r=ato Differential Revision: https://phabricator.services.mozilla.com/D23573
testing/marionette/browser.js
--- a/testing/marionette/browser.js
+++ b/testing/marionette/browser.js
@@ -394,17 +394,18 @@ browser.Context = class {
    * Open a new tab in the currently selected chrome window.
    */
   async openTab(focus = false) {
     let tab = null;
     let tabOpened = waitForEvent(this.window, "TabOpen");
 
     switch (this.driver.appName) {
       case "fennec":
-        tab = this.tabBrowser.addTab(null, {selected: focus});
+        tab = this.tabBrowser.addTab(null);
+        this.tabBrowser.selectTab(focus ? tab : this.tab);
         break;
 
       case "firefox":
         this.window.BrowserOpenTab();
         tab = this.tabBrowser.selectedTab;
 
         // The new tab is always selected by default. If focus is not wanted,
         // the previously tab needs to be selected again.