summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAnder Punnar <ander@kvlt.ee>2021-06-13 21:00:40 +0300
committerAnder Punnar <ander@kvlt.ee>2021-06-13 21:00:40 +0300
commitd5433702a5c5c8e2ac831929a304b21570366dba (patch)
treefb66db1e6c323e10b86b0f0e9beb1fd92fb26210 /tests
parent00a394506f149b600c9869a63dd37e847fe17cfe (diff)
parentc6cdd3f8440b22a294911ebed0492beea8913c49 (diff)
downloadqutebrowser-d5433702a5c5c8e2ac831929a304b21570366dba.tar.gz
qutebrowser-d5433702a5c5c8e2ac831929a304b21570366dba.zip
Merge remote-tracking branch 'origin/master' into 4nd3r/hostblock_subdomains
Diffstat (limited to 'tests')
-rw-r--r--tests/end2end/data/prefers_reduced_motion.html38
-rw-r--r--tests/end2end/fixtures/quteprocess.py4
-rw-r--r--tests/end2end/test_invocations.py25
3 files changed, 66 insertions, 1 deletions
diff --git a/tests/end2end/data/prefers_reduced_motion.html b/tests/end2end/data/prefers_reduced_motion.html
new file mode 100644
index 000000000..a37d43864
--- /dev/null
+++ b/tests/end2end/data/prefers_reduced_motion.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="utf-8">
+ <title>Prefers reduced motion test</title>
+ <style>
+#reduce-text {
+ display: none;
+}
+#no-preference-text {
+ display: none;
+}
+
+@media (prefers-reduced-motion: no-preference) {
+ #no-preference-text {
+ display: inline;
+ }
+ #missing-support-text {
+ display: none;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ #reduce-text {
+ display: inline;
+ }
+ #missing-support-text {
+ display: none;
+ }
+}
+ </style>
+ </head>
+ <body>
+ <p id="reduce-text">Reduced motion preference detected.</p>
+ <p id="no-preference-text">No preference detected.</p>
+ <p id="missing-support-text">Preference support missing.</p>
+ </body>
+</html>
diff --git a/tests/end2end/fixtures/quteprocess.py b/tests/end2end/fixtures/quteprocess.py
index 0c0cfc50f..264c81283 100644
--- a/tests/end2end/fixtures/quteprocess.py
+++ b/tests/end2end/fixtures/quteprocess.py
@@ -229,6 +229,10 @@ def is_ignored_chromium_message(line):
# gpu_process_transport_factory.cc(1019)] Lost UI shared context.
'Lost UI shared context.',
+ # [20870:20908:0607/081717.652282:ERROR:block_files.cc(465)] Failed to
+ # open /tmp/qutebrowser-basedir-cg284f_m/data/webengine/GPUCache/data_2
+ 'Failed to open *GPUCache*',
+
# Qt 5.12
# WORKAROUND for https://bugreports.qt.io/browse/QTBUG-70702
# [32123:32123:0923/224739.457307:ERROR:in_progress_cache_impl.cc(192)]
diff --git a/tests/end2end/test_invocations.py b/tests/end2end/test_invocations.py
index 97c04eb0d..b860feed0 100644
--- a/tests/end2end/test_invocations.py
+++ b/tests/end2end/test_invocations.py
@@ -752,6 +752,30 @@ def test_dark_mode_mathml(quteproc_new, request, qtbot):
)
+@testutils.qt514
+@pytest.mark.parametrize('value, preference', [
+ ('true', 'Reduced motion'),
+ ('false', 'No'),
+])
+@pytest.mark.skipif(
+ utils.is_windows,
+ reason="Outcome on Windows depends on system settings",
+)
+def test_prefers_reduced_motion(quteproc_new, request, value, preference):
+ if not request.config.webengine:
+ pytest.skip("Skipped with QtWebKit")
+
+ args = _base_args(request.config) + [
+ '--temp-basedir',
+ '-s', 'content.prefers_reduced_motion', value,
+ ]
+ quteproc_new.start(args)
+
+ quteproc_new.open_path('data/prefers_reduced_motion.html')
+ content = quteproc_new.get_content()
+ assert content == f"{preference} preference detected."
+
+
def test_unavailable_backend(request, quteproc_new):
"""Test starting with a backend which isn't available.
@@ -802,4 +826,3 @@ def test_json_logging_without_debug(request, quteproc_new, runtime_tmpdir):
quteproc_new.exit_expected = True
quteproc_new.start(args, env={'XDG_RUNTIME_DIR': str(runtime_tmpdir)})
assert not quteproc_new.is_running()
- assert not quteproc_new.captured_log