diff options
author | Ted Morse <ekpneo@users.noreply.github.com> | 2020-11-27 21:06:45 -0800 |
---|---|---|
committer | Ted Morse <ekpneo@users.noreply.github.com> | 2020-11-28 22:58:32 -0800 |
commit | 6feaeb247921de22318a7cc18251260ad1adbb86 (patch) | |
tree | 5c10d3ec331f3d0328813d74217d05e906fe24dc | |
parent | 314c81b24eb9f9457ccdb5c682d718cf24f24a76 (diff) | |
download | qutebrowser-6feaeb247921de22318a7cc18251260ad1adbb86.tar.gz qutebrowser-6feaeb247921de22318a7cc18251260ad1adbb86.zip |
Add invocation test for preferred colorscheme
With the addition of blink-settings for ensuring the correct color
scheme, this test makes sure the browser is obeying it via a media
match query through javascript. Any HTML page will do, so
`qute://version` is opened and tested against.
-rw-r--r-- | tests/end2end/test_invocations.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py index e34bd912d..74288fbc3 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -417,3 +417,23 @@ def test_referrer(quteproc_new, server, server2, request, value, expected): expected = expected.replace(key, str(val)) assert headers.get('Referer') == expected + + +@pytest.mark.qtwebkit_skip +@utils.qt514 +def test_preferred_colorscheme(request, quteproc_new): + """Make sure the the preferred colorscheme is set.""" + args = _base_args(request.config) + [ + '--temp-basedir', + '-s', 'colors.webpage.prefers_color_scheme_dark', 'true', + ] + quteproc_new.start(args) + + quteproc_new.open_path("qute://version") + quteproc_new.send_cmd(':jseval --world main ' + 'matchMedia("(prefers-color-scheme: dark)").matches') + line = quteproc_new.wait_for(message='True') + line.expected = True + + quteproc_new.send_cmd(':quit') + quteproc_new.wait_for_quit() |