For some reason, when comparing the repr in the two processes, we get different
results on OS X and Windows:
- expected: "fünf"
- "f\xfcnf" coming back from the subprocess on OS X
- "fnf" on Windows
Instead we're comparing the json dump now, which should be more predictable.
There are a lot of problems and flakiness with using a real clipboard.
Instead we now have a :debug-set-fake-clipboard command to set a text, and use
logging when getting the contents.
Fixes#1285.
It seems since the recent QClipboard changes we get a new warning
"QXcbClipboard: Cannot transfer data, no data available" in some tests.
This ignores the warning, let's hope the tests still work.
See #1285.
Otherwise, if a test fails to actually put something into the clipboard, we end
up pasting "Does this work?" which could e.g. trigger a search.
When it's cleared, we at least get some "clipboard is empty" error instead.
In the long run, we should detect any accidental external accesses using
mitmproxy, as per #1282. In the meantime, we try to detect duckduckgo requests
being logged and fail the tests if that happens.
However, a duckduckgo URL is logged in fuzzy_url during startup/config init,
which is why we ignore it there.
The-Compiler wants a more beautiful test case since the old one was
pretty weird and took lots of explaining at pytest demos, so I made a
new one. This one is a bit nicer on the eye and - to say it with
The-Compiler's words - has no "weird pixelated globe with the
geocities-like background".
To compensate for the globe I've put in some trivia facts so that - if
you are one of the people that like to stare at test pages - you can
always learn something.
Before we raised QtValueError (via qtutils.ensure_valid), but maybe there are
more callers out there which call fuzzy_url with an empty input - and it makes
more sense to raise InvalidUrlError which gets displayed to the user than
raising QtValueError which is more like an assertion.
This way we can instruct update_3rdparty to download a specific version
of pdfjs, e.g. to make debugging easier or to match the version of a
system package.
Syntax:
update_3rdparty.py -p 1.2.109
or
update_3rdparty.py --pdfjs=1.2.109
If the command line argument is not given, the script will automatically
download the latest release.