Fix lint and tests

This commit is contained in:
Florian Bruhin 2023-12-04 19:46:51 +01:00
parent 383f8a2e82
commit b40e1861c3
3 changed files with 8 additions and 5 deletions

View File

@ -150,7 +150,7 @@ class WebEngineSettings(websettings.AbstractSettings):
}
try:
_ATTRIBUTES['content.canvas_reading'] = Attr(
QWebEngineSettings.WebAttribute.ReadingFromCanvasEnabled) # type: ignore[attr-defined,unused-ignore]
QWebEngineSettings.WebAttribute.ReadingFromCanvasEnabled) # type: ignore[attr-defined,unused-ignore]
except AttributeError:
# Added in QtWebEngine 6.6
pass

View File

@ -1035,8 +1035,10 @@ content.javascript.legacy_touch_events:
type:
name: String
valid_values:
- always: Legacy touch events are always enabled. This might cause some websites to assume a mobile device.
- auto: Legacy touch events are only enabled if a touch screen was detected on startup.
- always: Legacy touch events are always enabled. This might cause some
websites to assume a mobile device.
- auto: Legacy touch events are only enabled if a touch screen was
detected on startup.
- never: Legacy touch events are always disabled.
default: never
backend: QtWebEngine

View File

@ -75,9 +75,10 @@ class TestQtArgs:
(['--qt-flag', 'foo', '--qt-flag', 'bar'],
[sys.argv[0], '--foo', '--bar']),
])
def test_qt_args(self, monkeypatch, config_stub, args, expected, parser):
def test_qt_args(self, request, monkeypatch, config_stub, args, expected, parser):
"""Test commandline with no Qt arguments given."""
expected.append("--touch-events=disabled") # passed unconditionally
if request.config.webengine:
expected.append("--touch-events=disabled") # passed unconditionally
parsed = parser.parse_args(args)
assert qtargs.qt_args(parsed) == expected