Days 37/38: Hints in master, tests
Hints
Yesterday I merged the pull request I opened for the rewritten hint drawing and implemented the missing bits so only visible hints are considered.
Together with some other small fixes and cleanups, I then merged the qtwebengine-hints branch, which means hints are now working fine apart from some corner cases with frames and iframes!
Tests
I added webelem.click() and webelem.hover() methods (to get some more code out of hints.py and provide something useful for a future plugin API) and added a new click-element command.
With that command, I was able to simplify a lot of tests (which used hinting to click elements before), and then work on getting the end-to-end tests to run with QtWebEngine.
This mostly meant implementing @qtwebengine_todo and @qtwebengine_skip tags and applying them all over the testsuite where things aren't ready yet. However, there also were some other fixes:
- yankpaste.feature checked requests despite that not being necessary, which was flaky on QtWebEngine due to caching.
- Due to caching, the HTTP server used for tests would send a HTTP "not modified" answer which needed to be whitelisted.
- Since hints are now async, the tests sometimes were faster than qutebrowser, so they needed some changes to wait until qutebrowser actually started hinting.
- Some tests waited for a specific tab to be focused which failed because with QtWebEngine, an internal QOpenGLWidget actually got the focus.
- "Running without the SUID sandbox" was logged by QtWebEngine (fixed in Qt 5.8) and failed the tests because it was an unknown message.
- Hint tests did set some options unavailable with QtWebEngine.
- Another test for :set used an option unavailable there.
The tests already found a handful of issues:
- :fake-key was not implemented yet, now it is
- QtWebEngine saved titles which were autogenerated from the URL, which are suppressed now.
- Hinting raised a CommandError when no hints were found outside the command handler (since hinting is now async) and crashed.
- Similarly, :view-source raised CommandError when used with an invalid URL.
- Some code sending custom key/mouse events segfaulted.
- Some tests which scroll with a very big value caused a memory leak and thus were skipped for now until I know about a good workaround.
I also decreased the time the testsuite waits for a log line to appear until it timeouts when a test is marked as TODO, which made the testsuite almost 5 minutes faster!
Some users also found another interesting bug: Mouse clicks are handled by an event filter which then (among other things) checks if the clicked element is editable. When closing a context menu, that event was however sent to the QMenu, and the filter got coordinates relative to the menu.
Now when the user clicked in the area to the left or top to the panel, the event filter got negative coordinates, which triggered an assertion when trying to get the element at a negative position. The solution for that was to ignore all events not going to the main widget.
The future
The next two weeks, I'll attend a preparation course for university. during which I won't have much time available for qutebrowser, so I expect it to get a bit more quiet again.
After that, I'll have another week or so until my study starts, during which I hope to work on adblocking and some other essential smaller features.
Of course, during the study I'll continue working on QtWebEngine as my time permits, but - unfortunately - not full-time anymore.