From 666279a900315b26873e0fc1428cf1df1ef037f5 Mon Sep 17 00:00:00 2001 From: Henrik Skupin Date: Thu, 26 Jul 2018 14:55:04 +0200 Subject: [PATCH] Bug 1478368 - [wdspec] Use a default window size of 800x600. r=ato Previously we set this window size when restoring all default values for a session during test teardown. Which means that the very first test after the browser has been started will run with the browser window default size. This change enforces that all tests use the default window size of 800x600. MozReview-Commit-ID: Kiog3Ri2RJT --HG-- extra : rebase_source : 971c1a17cdcc97d7880db8d8bdd50314369a2a91 --- .../web-platform/tests/webdriver/tests/support/fixtures.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/testing/web-platform/tests/webdriver/tests/support/fixtures.py b/testing/web-platform/tests/webdriver/tests/support/fixtures.py index 2e9e63262338..2e59d8f55ebf 100644 --- a/testing/web-platform/tests/webdriver/tests/support/fixtures.py +++ b/testing/web-platform/tests/webdriver/tests/support/fixtures.py @@ -19,6 +19,7 @@ default_script_timeout = 30 default_page_load_timeout = 300 default_implicit_wait_timeout = 0 +default_window_size = (800, 600) _current_session = None _custom_session = False @@ -72,7 +73,7 @@ def cleanup_session(session): This also includes bringing it out of maximized, minimized, or fullscreened state. """ - session.window.size = (800, 600) + session.window.size = default_window_size @ignore_exceptions def _restore_windows(session): @@ -213,6 +214,9 @@ def session(capabilities, configuration, request): if not _current_session.session_id: raise + # Enforce a fixed default window size + _current_session.window.size = default_window_size + yield _current_session cleanup_session(_current_session)