From fee35446bf1d714ac464b8df882577d617545237 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Wed, 21 Aug 2024 07:31:56 +0000 Subject: [PATCH] [marionette] Raise JavaScriptError if MarionetteCommands actor gets destroyed. Differential Revision: https://phabricator.services.mozilla.com/D219658 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1761634 gecko-commit: 2d8046b0452a0dafe4f832c2620ebc560855900e gecko-reviewers: webdriver-reviewers, Sasha, jdescottes --- .../wptrunner/wptrunner/executors/executormarionette.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tools/wptrunner/wptrunner/executors/executormarionette.py b/tools/wptrunner/wptrunner/executors/executormarionette.py index fe1fed136309ba..c1748f1ffda53e 100644 --- a/tools/wptrunner/wptrunner/executors/executormarionette.py +++ b/tools/wptrunner/wptrunner/executors/executormarionette.py @@ -275,15 +275,18 @@ def get_test_window(self, window_id, parent, timeout=5): def test_window_loaded(self): """Wait until the page in the new window has been loaded. - Hereby ignore Javascript execptions that are thrown when + Hereby ignore Javascript exceptions that are thrown when the document has been unloaded due to a process change. """ while True: try: self.parent.base.execute_script(self.window_loaded_script, asynchronous=True) break - except errors.JavascriptException: - pass + except errors.JavascriptException as e: + if e.message.startswith("Script evaluation aborted: Actor"): + # Special-case JavaScript errors for a JSWindowActor destroy + # until a decision is made on bug 1673478. + pass class MarionettePrefsProtocolPart(PrefsProtocolPart):