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. |
||
|---|---|---|
| .. | ||
| fixtures.py | ||
| logfail.py | ||
| messagemock.py | ||
| stubs.py | ||
| test_helper_utils.py | ||
| test_logfail.py | ||
| test_stubs.py | ||
| testutils.py | ||