Bug 1517796 - [wpt] Correctly dismiss user prompts in MarionetteTestharnessProtocolPart._close_windows(). r=jgraham
authorHenrik Skupin <mail@hskupin.info>
Mon, 07 Jan 2019 11:51:59 +0000
changeset 509799 fcb026c5194b6ab027c8556f383e6a709cd464c9
parent 509798 0a3a8b70b8bacd012d6165c3e909b0df1f95ba86
child 509800 4b28aeacad99de8473b64b11974687b1afb87075
push id10547
push userffxbld-merge
push dateMon, 21 Jan 2019 13:03:58 +0000
treeherdermozilla-beta@24ec1916bffe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1517796
milestone66.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 1517796 - [wpt] Correctly dismiss user prompts in MarionetteTestharnessProtocolPart._close_windows(). r=jgraham Using the "Switch To Window" command to check if a user prompt is open doesn't work because that command doesn't raise a "unexpected alert open" error. To fix that the "Close Window" command can be used for. Differential Revision: https://phabricator.services.mozilla.com/D15816
testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executormarionette.py
@@ -152,20 +152,19 @@ class MarionetteTestharnessProtocolPart(
             # We assume that the first handle returned corresponds to the runner,
             # but it hopefully doesn't matter too much if that assumption is
             # wrong since we reload the runner in that tab anyway.
             runner_handle = handles.pop(0)
             self.logger.info("Changing harness_window to %s" % runner_handle)
 
         for handle in handles:
             try:
-                self.dismiss_alert(lambda: self.marionette.switch_to_window(handle))
+                self.logger.info("Closing window %s" % handle)
                 self.marionette.switch_to_window(handle)
-                self.logger.info("Closing window %s" % handle)
-                self.marionette.close()
+                self.dismiss_alert(lambda: self.marionette.close())
             except errors.NoSuchWindowException:
                 # We might have raced with the previous test to close this
                 # window, skip it.
                 pass
         self.marionette.switch_to_window(runner_handle)
         return runner_handle
 
     def close_old_windows(self, url_protocol):