Bug 1351940 - [marionette] Only convert a valid outerWindowID to a string. r=ato
authorHenrik Skupin <mail@hskupin.info>
Wed, 28 Nov 2018 20:48:42 +0000
changeset 505035 95c294286e66c5e4d3ae15706247ad95357b34fd
parent 505034 e5c59d7e5a55cd3a312c7915072f57922cefeb1e
child 505036 9fda62ff71b434990997d833a373a229906eb2db
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersato
bugs1351940
milestone65.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 1351940 - [marionette] Only convert a valid outerWindowID to a string. r=ato Differential Revision: https://phabricator.services.mozilla.com/D13206
testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py
--- a/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py
+++ b/testing/marionette/puppeteer/firefox/firefox_puppeteer/ui/browser/tabbar.py
@@ -201,21 +201,21 @@ class TabBar(UIBaseLib):
 
         :returns: `handle` of the tab.
         """
         # TODO: This introduces coupling with marionette's window handles
         # implementation. To avoid this, the capacity to get the XUL
         # element corresponding to the active window according to
         # marionette or a similar ability should be added to marionette.
         handle = marionette.execute_script("""
-          let win = arguments[0].linkedBrowser;
-          if (!win) {
+          let browser = arguments[0].linkedBrowser;
+          if (!browser || browser.outerWindowID == null) {
             return null;
           }
-          return win.outerWindowID.toString();
+          return browser.outerWindowID.toString();
         """, script_args=[tab_element])
 
         return handle
 
 
 class Tab(UIBaseLib):
     """Wraps a tab DOM element."""