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 464073 d57870ac257d8a10b2ba34b60769d743b9552c52
parent 464072 1d23b016870aef983893b745c7b76fd16c486a24
child 464074 ee7dd744c695c2c16925d102a496444e846dc82b
push id35707
push userrmaries@mozilla.com
push dateFri, 15 Mar 2019 03:42:43 +0000
treeherdermozilla-central@5ce27c44f79e [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.