diff options
Diffstat (limited to 'testing/web-platform/mozilla/tests/webdriver/harness')
-rw-r--r-- | testing/web-platform/mozilla/tests/webdriver/harness/preferences_marionette.py (renamed from testing/web-platform/mozilla/tests/webdriver/harness/preferences.py) | 2 | ||||
-rw-r--r-- | testing/web-platform/mozilla/tests/webdriver/harness/preferences_remote_agent.py | 37 |
2 files changed, 38 insertions, 1 deletions
diff --git a/testing/web-platform/mozilla/tests/webdriver/harness/preferences.py b/testing/web-platform/mozilla/tests/webdriver/harness/preferences_marionette.py index b5cf36bd5e..e5d18aeb6b 100644 --- a/testing/web-platform/mozilla/tests/webdriver/harness/preferences.py +++ b/testing/web-platform/mozilla/tests/webdriver/harness/preferences_marionette.py @@ -2,5 +2,5 @@ from support.fixtures import get_pref def test_recommended_preferences(session): - has_recommended_prefs = get_pref(session, "remote.prefs.recommended") + has_recommended_prefs = get_pref(session, "remote.prefs.recommended.applied") assert has_recommended_prefs is True 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) |