From 82f2a37af56857585cb2bf868ef89eeba7e9b698 Mon Sep 17 00:00:00 2001 From: Geoffrey Sneddon Date: Fri, 31 Aug 2018 16:08:48 +0100 Subject: [PATCH] Fix get_test_window in SeleniumExecutor to use the window_id arg --- .../wptrunner/executors/executorselenium.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tools/wptrunner/wptrunner/executors/executorselenium.py b/tools/wptrunner/wptrunner/executors/executorselenium.py index d9b67968ddf66e..731d07bf8b66f4 100644 --- a/tools/wptrunner/wptrunner/executors/executorselenium.py +++ b/tools/wptrunner/wptrunner/executors/executorselenium.py @@ -95,14 +95,13 @@ def close_old_windows(self): def get_test_window(self, window_id, parent): test_window = None - if window_id: - try: - # Try this, it's in Level 1 but nothing supports it yet - win_s = self.webdriver.execute_script("return window['%s'];" % self.window_id) - win_obj = json.loads(win_s) - test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"] - except Exception: - pass + try: + # Try this, it's in Level 1 but nothing supports it yet + win_s = self.webdriver.execute_script("return window['%s'];" % window_id) + win_obj = json.loads(win_s) + test_window = win_obj["window-fcc6-11e5-b4f8-330a88ab9d7f"] + except Exception: + pass if test_window is None: after = self.webdriver.window_handles @@ -296,7 +295,7 @@ def do_testharness(self, protocol, url, timeout): parent_window = protocol.testharness.close_old_windows() # Now start the test harness protocol.base.execute_script(self.script % format_map) - test_window = protocol.testharness.get_test_window(webdriver, parent_window) + test_window = protocol.testharness.get_test_window(self.window_id, parent_window) handler = CallbackHandler(self.logger, protocol, test_window) while True: