Open The-Compiler opened 1 week ago
__________ TestWebEngineVersions.test_chromium_security_version_dict ___________
self = <test_version.TestWebEngineVersions object at 0x7ff5b9f9b8c0>
qapp = <PyQt6.QtWidgets.QApplication object at 0x7ff5c1759b30>
def test_chromium_security_version_dict(self, qapp):
"""Check if we infer the QtWebEngine security version properly.
Note this test mostly tests that our overview in version.py (also
intended for human readers) is accurate. The code we call here is never
going to be called in real-life situations, as the API is available.
"""
try:
from qutebrowser.qt.webenginecore import (
qWebEngineVersion,
qWebEngineChromiumSecurityPatchVersion,
)
except ImportError:
pytest.skip("Requires QtWebEngine 6.3+")
inferred = version.WebEngineVersions.from_webengine(
qWebEngineVersion(), source="API")
> assert inferred.chromium_security == qWebEngineChromiumSecurityPatchVersion()
Error: E AssertionError: assert None == '122.0.6261.128'
E + where None = WebEngineVersions(webengine=VersionNumber(6, 8), chromium=None, source='API', chromium_security=None, chromium_major=None).chromium_security
E + and '122.0.6261.128' = <built-in function qWebEngineChromiumSecurityPatchVersion>()
But QtWebEngine infos seem to be outdated, currently claiming the same as Qt 6.7 both in CHROMIUM_VERSION
as well as in code:
QtWebEngine 6.8
based on Chromium 118.0.5993.220
with security patches up to 122.0.6261.128 (plus any distribution patches)
(source: api)
tests/unit/utils/test_qtutils.py:498: Failure: Qt messages with level WARNING or above emitted
----------------------------- Captured Qt messages -----------------------------
QtWarningMsg: QSaveFile::commit: File (/tmp/pytest-of-user/pytest-0/test_failing_flush0/foo) is not open
probably just a new warning from Qt we can suppress for that test?
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_async_question_interrupted_by_async_one - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_async_question_interrupted_by_blocking_one - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_geolocation_with_ask__false - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_geolocation_with_ask__false_and_save - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_geolocation_with_ask__abort - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_always_rejecting_notifications - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'category': 'js', 'message': '[*] notification permission denied'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_always_accepting_notifications - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'category': 'js', 'message': '[*] notification permission granted'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_notifications_with_ask__false - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_notifications_with_ask__false_and_save - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_notifications_with_ask__true - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_notifications_with_ask__true_and_save - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_answering_notification_after_closing_tab - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
Error: FAILED tests/end2end/features/test_prompts_bdd.py::test_interrupting_ssl_prompt_during_a_notification_prompt - end2end.fixtures.testprocess.WaitForTimeout: Timed out after 15000ms waiting for {'message': 'Asking question *'}.
e.g.:
----> Waiting for 'Asking question *' in the log
[...]
07:58:57.045 DEBUG webelem webelem:click:411 Clicking <qutebrowser.browser.webengine.webengineelem.WebEngineElement html='<input type="button" onclick="get_notification_permission()" value="Get notification permission" id="button">'> with click_target ClickTarget.normal, force_event False
[...]
07:58:57.060 DEBUG js shared:javascript_log_message:190 [http://localhost:59211/data/prompt/notifications.html:28] [FAIL] unknown initial value for Notification.permission: granted
probably due to:
Added QWebEngineProfile::setPersistentPermissionsPolicy() to control how website permissions persist across browsing sessions. By default, incoming permissions are saved to disk.
I suppose we'll need at least a -D
flag (or maybe even a setting?) to set that to NoPersistentPermissions
(?) for tests.
Not much more we can do for Beta 1, I suppose:
I guess we could still investigate the QSaveFile
thing in the meantime. Beta 2 will be out on July 17th, though I'll be on holidays then and back on the 29th.
I've pushed some commits to silence the failing tests (not actual fixes) for now, and dug into the persistent permissions feature a tiny bit.
Missing security patch version in our dict
I just set the version numbers to what Qt is reporting. Even though it is incorrect 1) the test is green now for people raising PRs 2) it'll go red again when things next change, hopefully to be more correct https://github.com/qutebrowser/qutebrowser/commit/52632d0f994edbf8682e76790142007ac026cfd2
TestSavefileOpen.test_failing_flush failing
I just ignored the new warning message for that specific test. The test is deliberately trying to provoke this situations, so the warning is correct. https://github.com/qutebrowser/qutebrowser/commit/9ffa98535f7465cb3f93db5fb5b1beab2769813c
Permission caching/saving breaks tests
This is the more complicated one. It's a new feature in webengine that can remember the feature permissions you grant or deny. By default it remembers the permissions you grant per origin both on disk and in memory. This differs from our current behaviour in that we don't remember selections in memory and we only save to disk when the user chooses to.
For now I've just skipped the failing tests, but I think we are going to have to do proper adaptations to this feature for the following reasons:
https://github.com/qutebrowser/qutebrowser/commit/39f8ce51309b24b86c95002c4cca730ce26f39e5 then https://github.com/qutebrowser/qutebrowser/commit/68755ed850b1d41d488e86bf2c6f988b69b8bef3
Qt 6.8 Beta 1 [was released]. Doing the usual dance to get wheels:
Once again leads to a missing symbol....
which is:
QPageLayout::setBottomMargin(double)