Draft: Fix several tests and add a few new ones
Fixes #27105 (closed), #40001 (closed), #40003 (closed), #40004 (closed), #40005 (closed).
Also fixes #27137 (closed), #28520 (closed), #28665 (closed), #28798 (closed), #28876 (closed), #30333 (closed), #30339 (closed), #30340 (closed), #32537 (closed), #34189 (closed), #40002 (closed).
There are some dependencies between these commits, so I thought we could have one single branch/MR for these issues. But we can do it differently if it's easier for reviewing, what do you think @gk?
Currently tested against a build with acat/tor-browser@7dc69f27.
Edited by Georg Koppen