From 36d22d82aa202bb199967e9512281e9a53db42c9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 21:33:14 +0200 Subject: Adding upstream version 115.7.0esr. Signed-off-by: Daniel Baumann --- .../harness/firefox_ui_harness/__init__.py | 7 ++++++ .../firefox_ui_harness/arguments/__init__.py | 5 ++++ .../harness/firefox_ui_harness/arguments/base.py | 17 +++++++++++++ .../harness/firefox_ui_harness/cli_functional.py | 22 +++++++++++++++++ .../harness/firefox_ui_harness/runners/__init__.py | 5 ++++ .../harness/firefox_ui_harness/runners/base.py | 28 ++++++++++++++++++++++ 6 files changed, 84 insertions(+) create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/__init__.py create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/arguments/__init__.py create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/arguments/base.py create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/cli_functional.py create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/runners/__init__.py create mode 100644 testing/firefox-ui/harness/firefox_ui_harness/runners/base.py (limited to 'testing/firefox-ui/harness/firefox_ui_harness') diff --git a/testing/firefox-ui/harness/firefox_ui_harness/__init__.py b/testing/firefox-ui/harness/firefox_ui_harness/__init__.py new file mode 100644 index 0000000000..dad49461c7 --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/__init__.py @@ -0,0 +1,7 @@ +# 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/. + +__version__ = "1.4.0" + +from . import cli_functional diff --git a/testing/firefox-ui/harness/firefox_ui_harness/arguments/__init__.py b/testing/firefox-ui/harness/firefox_ui_harness/arguments/__init__.py new file mode 100644 index 0000000000..c685a8c23e --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/arguments/__init__.py @@ -0,0 +1,5 @@ +# 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/. + +from firefox_ui_harness.arguments.base import FirefoxUIArguments diff --git a/testing/firefox-ui/harness/firefox_ui_harness/arguments/base.py b/testing/firefox-ui/harness/firefox_ui_harness/arguments/base.py new file mode 100644 index 0000000000..d9d1fc3246 --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/arguments/base.py @@ -0,0 +1,17 @@ +# 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/. + +from marionette_harness import BaseMarionetteArguments + + +class FirefoxUIBaseArguments(object): + name = "Firefox UI Tests" + args = [] + + +class FirefoxUIArguments(BaseMarionetteArguments): + def __init__(self, **kwargs): + super(FirefoxUIArguments, self).__init__(**kwargs) + + self.register_argument_container(FirefoxUIBaseArguments()) diff --git a/testing/firefox-ui/harness/firefox_ui_harness/cli_functional.py b/testing/firefox-ui/harness/firefox_ui_harness/cli_functional.py new file mode 100644 index 0000000000..339a500f19 --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/cli_functional.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +# 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/. + +from marionette_harness.runtests import cli as mn_cli + +from firefox_ui_harness.arguments import FirefoxUIArguments +from firefox_ui_harness.runners import FirefoxUITestRunner + + +def cli(args=None): + mn_cli( + runner_class=FirefoxUITestRunner, + parser_class=FirefoxUIArguments, + args=args, + ) + + +if __name__ == "__main__": + cli() diff --git a/testing/firefox-ui/harness/firefox_ui_harness/runners/__init__.py b/testing/firefox-ui/harness/firefox_ui_harness/runners/__init__.py new file mode 100644 index 0000000000..e2a7ef01f6 --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/runners/__init__.py @@ -0,0 +1,5 @@ +# 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/. + +from firefox_ui_harness.runners.base import FirefoxUITestRunner diff --git a/testing/firefox-ui/harness/firefox_ui_harness/runners/base.py b/testing/firefox-ui/harness/firefox_ui_harness/runners/base.py new file mode 100644 index 0000000000..41cfd86544 --- /dev/null +++ b/testing/firefox-ui/harness/firefox_ui_harness/runners/base.py @@ -0,0 +1,28 @@ +# 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/. + +import os + +from marionette_harness import BaseMarionetteTestRunner, MarionetteTestCase + + +class FirefoxUITestRunner(BaseMarionetteTestRunner): + def __init__(self, **kwargs): + super(FirefoxUITestRunner, self).__init__(**kwargs) + + # select the appropriate GeckoInstance + self.app = "fxdesktop" + + # low-noise log messages useful in tests + # TODO: should be moved to individual tests once bug 1386810 + # is fixed + moz_log = "" + if "MOZ_LOG" in os.environ: + moz_log = os.environ["MOZ_LOG"] + if len(moz_log) > 0: + moz_log += "," + moz_log += "UrlClassifierStreamUpdater:1" + os.environ["MOZ_LOG"] = moz_log + + self.test_handlers = [MarionetteTestCase] -- cgit v1.2.3