diff options
author | Ted Morse <ekpneo@users.noreply.github.com> | 2020-11-27 21:06:45 -0800 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-12-03 14:44:30 +0100 |
commit | d634c5f37f961c0f0cfc5ad0537dcb9ca381dc7e (patch) | |
tree | 66c38fa01bdbf8f4cbd782e3c988fe4ae4a0e001 | |
parent | d9c299e23edb7b336ec2f3264dd831a4e6eb3482 (diff) | |
download | qutebrowser-d634c5f37f961c0f0cfc5ad0537dcb9ca381dc7e.tar.gz qutebrowser-d634c5f37f961c0f0cfc5ad0537dcb9ca381dc7e.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.
(cherry picked from commit 6feaeb247921de22318a7cc18251260ad1adbb86)
-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 cd9aefe16..7fc38cdc4 100644 --- a/tests/end2end/test_invocations.py +++ b/tests/end2end/test_invocations.py @@ -405,3 +405,23 @@ def test_qute_settings_persistence(short_tmpdir, request, quteproc_new): quteproc_new.send_cmd(':quit') quteproc_new.wait_for_quit() + + +@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() |