diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py')
-rw-r--r-- | testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py b/testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py new file mode 100644 index 0000000000..59db5fa0e3 --- /dev/null +++ b/testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py @@ -0,0 +1,37 @@ +import pytest +from support.helpers import read_user_preferences +from tests.support.sync import Poll + + +@pytest.mark.parametrize( + "value", + [ + {"pref_value": 1, "use_cdp": False, "use_bidi": True}, + {"pref_value": 2, "use_cdp": True, "use_bidi": False}, + {"pref_value": 3, "use_cdp": True, "use_bidi": True}, + ], + ids=["bidi only", "cdp only", "bidi and cdp"], +) +def test_remote_agent_recommended_preferences_applied(browser, value): + # Marionette cannot be enabled for this test because it will also set the + # recommended preferences. Therefore only enable Remote Agent protocols. + current_browser = browser( + extra_prefs={ + "remote.active-protocols": value["pref_value"], + }, + use_cdp=value["use_cdp"], + use_bidi=value["use_bidi"], + ) + + def pref_is_set(_): + preferences = read_user_preferences(current_browser.profile.profile, "prefs.js") + return preferences.get("remote.prefs.recommended.applied", False) + + # Without Marionette enabled preferences cannot be retrieved via script evaluation yet. + wait = Poll( + None, + timeout=5, + ignored_exceptions=FileNotFoundError, + message="""Preference "remote.prefs.recommended.applied" is not true""", + ) + wait.until(pref_is_set) |