From d634c5f37f961c0f0cfc5ad0537dcb9ca381dc7e Mon Sep 17 00:00:00 2001 From: Ted Morse Date: Fri, 27 Nov 2020 21:06:45 -0800 Subject: 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) --- tests/end2end/test_invocations.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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() -- cgit v1.2.3-54-g00ecf