Debian Codegraph @

testing/web-platform/mozilla/tests/webdriver/harness/system_access.py

raw
1 import pytest
2 from support.context import using_context
3 from support.helpers import clear_pref
4 from webdriver import error
5
6
7 def test_enabled_by_default(session):
8 with pytest.raises(error.UnsupportedOperationException):
9 with using_context(session, "chrome"):
10 session.window_handle
11
12
13 @pytest.mark.capabilities(
14 {
15 "moz:firefoxOptions": {
16 "prefs": {
17 "remote.system-access-check.enabled": False,
18 },
19 },
20 }
21 )
22 def test_opt_out_with_preference(session):
23 try:
24 with using_context(session, "chrome"):
25 session.window_handle
26 finally:
27 # Clear preference so that it doesn't leak into following tests
28 clear_pref(session, "remote.system-access-check.enabled")