diff options
author | toofar <toofar@spalge.com> | 2024-03-23 11:14:53 +1300 |
---|---|---|
committer | toofar <toofar@spalge.com> | 2024-03-23 11:51:35 +1300 |
commit | 52106c383b41ea7629399f75059bbcba9abb1ba6 (patch) | |
tree | 4b56c7d5d00a29694a041847c96a11de683f8227 /tests/unit/utils/test_version.py | |
parent | 93b8438ebc418d880fb3f0d4eb5ae86df08488dc (diff) | |
download | qutebrowser-52106c383b41ea7629399f75059bbcba9abb1ba6.tar.gz qutebrowser-52106c383b41ea7629399f75059bbcba9abb1ba6.zip |
Show chromium security patch version in :versionfeat/7187_chromium_security_patch_in_version
Webengine added a getter for their chromium patch level back in Qt 6.3,
since they backport security fixes from chromium in the periods between
doing major chromium feature upgrades.
It's pulled from a hardcoded string in the webengine source
`src/core/web_engine_context.cpp` that's manually updated when they
backport something.
The "(plus any distribution patches)" bit in there is because it was
pointed out that some distributions backport their own security patches
or even use webengine from a branch when the hardcoded string only gets
updated at release time, despite patches being backported in the
meantime.
Closes: https://github.com/qutebrowser/qutebrowser/issues/7187
Diffstat (limited to 'tests/unit/utils/test_version.py')
-rw-r--r-- | tests/unit/utils/test_version.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/unit/utils/test_version.py b/tests/unit/utils/test_version.py index 38134b40e..f24bf2a7a 100644 --- a/tests/unit/utils/test_version.py +++ b/tests/unit/utils/test_version.py @@ -915,6 +915,17 @@ class TestWebEngineVersions: source='faked'), "QtWebEngine 5.15.2, based on Chromium 87.0.4280.144 (from faked)", ), + ( + version.WebEngineVersions( + webengine=utils.VersionNumber(5, 15, 2), + chromium='87.0.4280.144', + chromium_security='9000.1', + source='faked'), + ( + "QtWebEngine 5.15.2, based on Chromium 87.0.4280.144, with security " + "patches up to 9000.1 (plus any distribution patches) (from faked)" + ), + ), ]) def test_str(self, version, expected): assert str(version) == expected @@ -1024,6 +1035,20 @@ class TestWebEngineVersions: assert inferred == real + def test_real_chromium_security_version(self, qapp): + """Check the API for reading the chromium security patch version.""" + try: + from qutebrowser.qt.webenginecore import ( + qWebEngineChromiumVersion, + qWebEngineChromiumSecurityPatchVersion, + ) + except ImportError: + pytest.skip("Requires QtWebEngine 6.3+") + + base = utils.VersionNumber.parse(qWebEngineChromiumVersion()) + security = utils.VersionNumber.parse(qWebEngineChromiumSecurityPatchVersion()) + assert security >= base + class FakeQSslSocket: |