From 258fcec9ad09ed982f1f9921a006e0ee8b90a515 Mon Sep 17 00:00:00 2001 From: Paul Prokhorov Date: Tue, 21 May 2019 17:25:05 +0300 Subject: [PATCH] Removed variables DEFAULT_TINY_FIREFOX_TIMEOUT and DEFAULT_SHORT_FIREFOX_TIMEOUT from src/core/api/settings.py Created settings.py in targets/firefox with wait time constants in the FirefoxSettings class Added import for FirefoxSettings class into test_dependencies.py --- src/core/api/settings.py | 26 -------------------------- targets/firefox/settings.py | 11 +++++++++++ targets/firefox/test_dependencies.py | 2 ++ 3 files changed, 13 insertions(+), 26 deletions(-) create mode 100644 targets/firefox/settings.py diff --git a/src/core/api/settings.py b/src/core/api/settings.py index 3d0ea20e..1e9ba702 100644 --- a/src/core/api/settings.py +++ b/src/core/api/settings.py @@ -56,8 +56,6 @@ class _Settings: DEFAULT_UI_DELAY_SHORT = 0.5 DEFAULT_UI_DELAY_LONG = 2.5 DEFAULT_SYSTEM_DELAY = 5 - DEFAULT_TINY_FIREFOX_TIMEOUT = 3 - DEFAULT_SHORT_FIREFOX_TIMEOUT = 5 DEFAULT_FIREFOX_TIMEOUT = 10 DEFAULT_FX_PREFS = { # Don't automatically update the application @@ -114,11 +112,7 @@ class _Settings: highlight_color=DEFAULT_HIGHLIGHT_COLOR, highlight_thickness=DEFAULT_HIGHLIGHT_THICKNESS, mouse_scroll_step=DEFAULT_MOUSE_SCROLL_STEP, - tiny_firefox_timeout=DEFAULT_TINY_FIREFOX_TIMEOUT, - short_firefox_timeout=DEFAULT_SHORT_FIREFOX_TIMEOUT, firefox_timeout=DEFAULT_FIREFOX_TIMEOUT, - site_load_timeout=DEFAULT_SITE_LOAD_TIMEOUT, - heavy_site_load_timeout=DEFAULT_HEAVY_SITE_LOAD_TIMEOUT, key_shortcut_delay=DEFAULT_KEY_SHORTCUT_DELAY, site_load_timeout=DEFAULT_SITE_LOAD_TIMEOUT, default_fx_prefs=DEFAULT_FX_PREFS): @@ -141,11 +135,7 @@ class _Settings: self.highlight_thickness = highlight_thickness self.mouse_scroll_step = mouse_scroll_step self.key_shortcut_delay = key_shortcut_delay - self.tiny_firefox_timeout = tiny_firefox_timeout - self.short_firefox_timeout = short_firefox_timeout self.firefox_timeout = firefox_timeout - self.site_load_timeout = site_load_timeout - self.heavy_site_load_timeout = heavy_site_load_timeout self.default_fx_prefs = default_fx_prefs self.site_load_timeout = site_load_timeout @@ -157,22 +147,6 @@ class _Settings: def FIREFOX_TIMEOUT(self): return self.firefox_timeout - @property - def TINY_FIREFOX_TIMEOUT(self): - return self.tiny_firefox_timeout - - @property - def SHORT_FIREFOX_TIMEOUT(self): - return self.short_firefox_timeout - - @property - def SITE_LOAD_TIMEOUT(self): - return self.site_load_timeout - - @property - def HEAVY_SITE_LOAD_TIMEOUT(self): - return self.heavy_site_load_timeout - @property def SYSTEM_DELAY(self): return self.system_delay diff --git a/targets/firefox/settings.py b/targets/firefox/settings.py new file mode 100644 index 00000000..6f407ecb --- /dev/null +++ b/targets/firefox/settings.py @@ -0,0 +1,11 @@ +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this file, +# You can obtain one at http://mozilla.org/MPL/2.0/. + + +class FirefoxSettings: + TINY_FIREFOX_TIMEOUT = 3 + SHORT_FIREFOX_TIMEOUT = 5 + FIREFOX_TIMEOUT = 10 + SITE_LOAD_TIMEOUT = 30 + HEAVY_SITE_LOAD_TIMEOUT = 90 diff --git a/targets/firefox/test_dependencies.py b/targets/firefox/test_dependencies.py index 99df6ac5..28768533 100644 --- a/targets/firefox/test_dependencies.py +++ b/targets/firefox/test_dependencies.py @@ -21,3 +21,5 @@ from targets.firefox.firefox_ui.tabs import Tabs from targets.firefox.firefox_ui.download_dialog import DownloadDialog from targets.firefox.firefox_ui.about_preferences import AboutPreferences from targets.firefox.firefox_ui.about_addons import * + +from targets.firefox.settings import FirefoxSettings