qutebrowser/tests/helpers
toofar 8f89499cd5 Set up custom profile for webengine_tab fixture
Make sure webenginesettings.default_profile is set before creating a
webengine tab. The webengine_tab fixture is used in the web_tab and
tabbed_browser fixtures.

Previously when `WebEngineView.__init__()` ran default_profile was set
to None which was causing the tabs to be created pointing to the Qt
default profile. Which was working fine until I moved the common JS
scripts used for hint mode etc up to the profile, now they just weren't
getting run.

Unfortunately using a fully set up default profile was too tricky for
me. The stuff in webenginesettings around setting up the default profile
is written specifically for setting up global stuff when the real
application. Apart from init_profile() depending on a bunch of other
global singletons (more to set up) the user agent setting is hard to
work with. There is an assert in `_init_default_profile()` if the global
user agent string is already set. If you bypass the global user agent
string then websettings chokes on it not being set (websettings is
called from webenginesettings).

That's probably all possible to unpick, just need to go through the
codepaths noting down what the regiments for the application path are
and what needs to be operable for tests. We will probably make it a bit
better when moving more towards containers anyway.

Alternatively we could have a session/request scope autouse=True fixture
to set up all the real global stuff. That might be benefitial to make
the tests faster anyway. Going through the full profile setup stuff for
every test might make them a bit slower.

A couple of the caret tests are still failing. Not sure why.
2023-05-21 15:32:32 +12:00
..
fixtures.py Set up custom profile for webengine_tab fixture 2023-05-21 15:32:32 +12:00
logfail.py pylint: Fix some legitimate issues 2021-12-03 12:04:59 +01:00
messagemock.py Run scripts/dev/rewrite_qt_imports.sh 2022-08-23 18:09:11 +02:00
stubs.py Merge branch 'qt6-v2' into master-qt6 2023-03-17 20:30:13 +01:00
test_helper_utils.py qt 6: Fix getting enum members in tests 2022-08-23 18:31:41 +02:00
test_logfail.py doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
test_stubs.py doc: Switch URLs to https 2021-01-26 15:19:01 +01:00
testutils.py Merge branch 'master' into qt6-v2 2022-11-20 15:48:00 +13:00