diff options
author | Florian Bruhin <me@the-compiler.org> | 2020-11-03 14:00:36 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2020-11-04 18:30:04 +0100 |
commit | 160831c5bd52a158456abb48d8504a044a02e8f2 (patch) | |
tree | b8c73915a598be8fa61ce71ceb4f9cf2a664c4d6 | |
parent | 5e79574f70cca3fbe8d923731d885a9134829959 (diff) | |
download | qutebrowser-160831c5bd52a158456abb48d8504a044a02e8f2.tar.gz qutebrowser-160831c5bd52a158456abb48d8504a044a02e8f2.zip |
old qt: Remove conditional and old tests
-rw-r--r-- | pytest.ini | 2 | ||||
-rw-r--r-- | tests/conftest.py | 12 | ||||
-rw-r--r-- | tests/end2end/features/downloads.feature | 38 | ||||
-rw-r--r-- | tests/end2end/features/hints.feature | 12 | ||||
-rw-r--r-- | tests/end2end/features/javascript.feature | 19 | ||||
-rw-r--r-- | tests/end2end/features/keyinput.feature | 25 | ||||
-rw-r--r-- | tests/end2end/features/misc.feature | 18 | ||||
-rw-r--r-- | tests/end2end/features/prompts.feature | 7 | ||||
-rw-r--r-- | tests/end2end/features/qutescheme.feature | 1 | ||||
-rw-r--r-- | tests/end2end/features/tabs.feature | 11 | ||||
-rw-r--r-- | tests/helpers/utils.py | 8 | ||||
-rw-r--r-- | tests/unit/browser/test_caret.py | 4 | ||||
-rw-r--r-- | tests/unit/browser/webengine/test_webenginedownloads.py | 6 | ||||
-rw-r--r-- | tests/unit/browser/webengine/test_webenginesettings.py | 6 | ||||
-rw-r--r-- | tests/unit/browser/webkit/test_cache.py | 6 | ||||
-rw-r--r-- | tests/unit/config/test_qtargs.py | 2 | ||||
-rw-r--r-- | tests/unit/mainwindow/statusbar/test_url.py | 5 | ||||
-rw-r--r-- | tests/unit/utils/test_urlutils.py | 8 |
18 files changed, 14 insertions, 176 deletions
diff --git a/pytest.ini b/pytest.ini index 0b4fecf37..2906ada10 100644 --- a/pytest.ini +++ b/pytest.ini @@ -30,10 +30,8 @@ markers = qtwebkit_skip: Tests not applicable with QtWebKit qtwebengine_flaky: Tests which are flaky (and currently skipped) with QtWebEngine qtwebengine_mac_xfail: Tests which fail on macOS with QtWebEngine - js_prompt: Tests needing to display a javascript prompt this: Used to mark tests during development no_invalid_lines: Don't fail on unparseable lines in end2end tests - qtbug60673: Tests which are broken if the conversion from orange selection to real selection is flaky fake_os: Fake utils.is_* to a fake operating system unicode_locale: Tests which need a unicode locale to work qtwebkit6021_xfail: Tests which would fail on WebKit version 602.1 diff --git a/tests/conftest.py b/tests/conftest.py index 6c0c716c2..017c11ba8 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -101,13 +101,6 @@ def _apply_platform_markers(config, item): sys.getfilesystemencoding() == 'ascii', "Skipped because of ASCII locale"), - ('qtbug60673', - pytest.mark.xfail, - qtutils.version_check('5.8') and - not qtutils.version_check('5.10') and - config.webengine, - "Broken on webengine due to " - "https://bugreports.qt.io/browse/QTBUG-60673"), ('qtwebkit6021_xfail', pytest.mark.xfail, version.qWebKitVersion and # type: ignore[unreachable] @@ -175,11 +168,6 @@ def pytest_collection_modifyitems(config, items): _apply_platform_markers(config, item) if list(item.iter_markers('xfail_norun')): item.add_marker(pytest.mark.xfail(run=False)) - if list(item.iter_markers('js_prompt')): - if config.webengine: - item.add_marker(pytest.mark.skipif( - PYQT_VERSION <= 0x050700, - reason='JS prompts are not supported with PyQt 5.7')) if deselected: deselected_items.append(item) diff --git a/tests/end2end/features/downloads.feature b/tests/end2end/features/downloads.feature index a440590b8..df2e10b46 100644 --- a/tests/end2end/features/downloads.feature +++ b/tests/end2end/features/downloads.feature @@ -101,18 +101,6 @@ Feature: Downloading things from a website. And I run :leave-mode Then no crash should happen - # https://github.com/qutebrowser/qutebrowser/issues/4240 - @qt<5.11.2 - Scenario: Downloading with SSL errors (issue 1413) - When SSL is supported - And I clear SSL errors - And I set content.ssl_strict to ask - And I set downloads.location.prompt to false - And I download an SSL page - And I wait for "Entering mode KeyMode.* (reason: question asked)" in the log - And I run :prompt-accept - Then the error "Download error: SSL handshake failed" should be shown - Scenario: Closing window with downloads.remove_finished timeout (issue 1242) When I set downloads.remove_finished to 500 And I open data/downloads/download.bin in a new window without waiting @@ -148,16 +136,16 @@ Feature: Downloading things from a website. And I wait until the download is finished Then the downloaded file download with spaces.bin should exist - @qtwebkit_skip @qt<5.9 @qt>=5.13 - Scenario: Downloading a file with evil content-disposition header (Qt 5.8 or older and 5.13 and newer) + @qtwebkit_skip @qt>=5.13 + Scenario: Downloading a file with evil content-disposition header (Qt 5.13 and newer) # Content-Disposition: download; filename=..%2Ffoo When I open response-headers?Content-Disposition=download;%20filename%3D..%252Ffoo without waiting And I wait until the download is finished Then the downloaded file ../foo should not exist And the downloaded file foo should exist - @qtwebkit_skip @qt<5.13 @qt>=5.9 - Scenario: Downloading a file with evil content-disposition header (Qt 5.9 to 5.12) + @qtwebkit_skip @qt<5.13 + Scenario: Downloading a file with evil content-disposition header (Qt 5.12) # Content-Disposition: download; filename=..%2Ffoo When I open response-headers?Content-Disposition=download;%20filename%3D..%252Ffoo without waiting And I wait until the download is finished @@ -211,24 +199,6 @@ Feature: Downloading things from a website. does-not-exist does-not-exist - @qtwebkit_skip @qt<5.10 - Scenario: Retrying a failed download with QtWebEngine (Qt < 5.10) - When I open data/downloads/issue2298.html - And I run :click-element id download - And I wait for "Download error: *" in the log - And I run :download-retry - Then the error "Retrying downloads is unsupported *" should be shown - - @qtwebkit_skip @qt==5.10.1 - Scenario: Retrying a failed download with QtWebEngine (Qt 5.10) - When I open data/downloads/issue2298.html - And I run :click-element id download - And I wait for "Download error: *" in the log - And I run :download-retry - # For some reason it doesn't actually try again here, but let's hope it - # works e.g. on a connection loss, which we can't test automatically. - Then "Retrying downloads is unsupported *" should not be logged - @flaky Scenario: Retrying with count When I run :download http://localhost:(port)/data/downloads/download.bin diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 35e48c483..271450d90 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -179,18 +179,6 @@ Feature: Using hints And I hint with args "all run message-info {hint-url}" and follow a Then the message "http://localhost:(port)/data/hello.txt" should be shown - @qt<5.11 - Scenario: Clicking an invalid link - When I open data/invalid_link.html - And I hint with args "all" and follow a - Then the error "Invalid link clicked - *" should be shown - - @qt<5.11 - Scenario: Clicking an invalid link opening in a new tab - When I open data/invalid_link.html - And I hint with args "all tab" and follow a - Then the error "Invalid link clicked - *" should be shown - Scenario: Hinting inputs without type When I open data/hints/input.html And I hint with args "inputs" and follow a diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index a4c3d1338..9e0226db3 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -124,25 +124,6 @@ Feature: Javascript stuff # https://github.com/qutebrowser/qutebrowser/issues/1190 # https://github.com/qutebrowser/qutebrowser/issues/2495 - # Currently broken on Windows and on Qt 5.12 - # https://github.com/qutebrowser/qutebrowser/issues/4230 - @posix @qt<5.12 - Scenario: Checking visible/invisible window size - When I run :tab-only - And I open data/javascript/windowsize.html in a new background tab - And I wait for "[*/data/javascript/windowsize.html:*] loaded" in the log - And I run :tab-next - Then the window sizes should be the same - - @flaky @qt<5.12 - Scenario: Checking visible/invisible window size with vertical tabbar - When I run :tab-only - And I set tabs.position to left - And I open data/javascript/windowsize.html in a new background tab - And I wait for "[*/data/javascript/windowsize.html:*] loaded" in the log - And I run :tab-next - Then the window sizes should be the same - @flaky Scenario: Have a GreaseMonkey script run at page start When I have a GreaseMonkey file saved for document-start with noframes unset diff --git a/tests/end2end/features/keyinput.feature b/tests/end2end/features/keyinput.feature index 2769e3dc3..5dd6ef79d 100644 --- a/tests/end2end/features/keyinput.feature +++ b/tests/end2end/features/keyinput.feature @@ -18,31 +18,6 @@ Feature: Keyboard input # input.forward_unbound_keys - @qt<5.11.1 - Scenario: Forwarding all keys - When I open data/keyinput/log.html - And I set input.forward_unbound_keys to all - And I press the key "," - And I press the key "<F1>" - # , - Then the javascript message "key press: 188" should be logged - And the javascript message "key release: 188" should be logged - # <F1> - And the javascript message "key press: 112" should be logged - And the javascript message "key release: 112" should be logged - - @qt<5.11.1 - Scenario: Forwarding special keys - When I open data/keyinput/log.html - And I set input.forward_unbound_keys to auto - And I press the keys ",<F1>" - # <F1> - Then the javascript message "key press: 112" should be logged - And the javascript message "key release: 112" should be logged - # , - And the javascript message "key press: 188" should not be logged - And the javascript message "key release: 188" should not be logged - Scenario: Forwarding no keys When I open data/keyinput/log.html And I set input.forward_unbound_keys to none diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index b88c6aa28..c2733fce7 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -309,7 +309,6 @@ Feature: Various utility commands. And I press the key "<Ctrl-C>" Then no crash should happen - @js_prompt Scenario: Focusing download widget via Tab (original issue) When I open data/prompt/jsprompt.html And I run :click-element id button @@ -501,25 +500,14 @@ Feature: Various utility commands. ## Renderer crashes # Skipped on Windows as "... has stopped working" hangs. - @qtwebkit_skip @no_invalid_lines @posix @qt<5.9 + @qtwebkit_skip @no_invalid_lines @posix Scenario: Renderer crash When I run :open -t chrome://crash - Then the error "Renderer process crashed" should be shown - - @qtwebkit_skip @no_invalid_lines @qt<5.9 - Scenario: Renderer kill - When I run :open -t chrome://kill - Then the error "Renderer process was killed" should be shown - - # Skipped on Windows as "... has stopped working" hangs. - @qtwebkit_skip @no_invalid_lines @posix @qt>=5.9 - Scenario: Renderer crash (5.9) - When I run :open -t chrome://crash Then "Renderer process crashed" should be logged And "* 'Error loading chrome://crash/'" should be logged - @qtwebkit_skip @no_invalid_lines @qt>=5.9 @flaky - Scenario: Renderer kill (5.9) + @qtwebkit_skip @no_invalid_lines @flaky + Scenario: Renderer kill When I run :open -t chrome://kill Then "Renderer process was killed" should be logged And "* 'Error loading chrome://kill/'" should be logged diff --git a/tests/end2end/features/prompts.feature b/tests/end2end/features/prompts.feature index 96532dc8c..a0b550054 100644 --- a/tests/end2end/features/prompts.feature +++ b/tests/end2end/features/prompts.feature @@ -39,7 +39,6 @@ Feature: Prompts And I run :leave-mode Then the javascript message "confirm reply: false" should be logged - @js_prompt Scenario: Javascript prompt When I open data/prompt/jsprompt.html And I run :click-element id button @@ -48,7 +47,6 @@ Feature: Prompts And I run :prompt-accept Then the javascript message "Prompt reply: prompt test" should be logged - @js_prompt Scenario: Javascript prompt with default When I open data/prompt/jsprompt.html And I run :click-element id button-default @@ -56,7 +54,6 @@ Feature: Prompts And I run :prompt-accept Then the javascript message "Prompt reply: default" should be logged - @js_prompt Scenario: Rejected javascript prompt When I open data/prompt/jsprompt.html And I run :click-element id button @@ -137,7 +134,6 @@ Feature: Prompts # Shift-Insert with prompt (issue 1299) - @js_prompt Scenario: Pasting via shift-insert in prompt mode When selection is supported And I put "insert test" into the primary selection @@ -148,7 +144,6 @@ Feature: Prompts And I run :prompt-accept Then the javascript message "Prompt reply: insert test" should be logged - @js_prompt Scenario: Pasting via shift-insert without it being supported When selection is not supported And I put "insert test" into the primary selection @@ -160,7 +155,6 @@ Feature: Prompts And I run :prompt-accept Then the javascript message "Prompt reply: clipboard test" should be logged - @js_prompt Scenario: Using content.javascript.prompt When I set content.javascript.prompt to false And I open data/prompt/jsprompt.html @@ -396,7 +390,6 @@ Feature: Prompts Then the javascript message "Alert done" should be logged And the error "No value is permitted with alert prompts!" should be shown - @js_prompt Scenario: Javascript prompt with value When I set content.javascript.prompt to true And I open data/prompt/jsprompt.html diff --git a/tests/end2end/features/qutescheme.feature b/tests/end2end/features/qutescheme.feature index 5eb32e8f9..c79798970 100644 --- a/tests/end2end/features/qutescheme.feature +++ b/tests/end2end/features/qutescheme.feature @@ -185,7 +185,6 @@ Feature: Special qute:// pages And I open data/misc/test.pdf without waiting Then "Download test.pdf finished" should be logged - @qtwebengine_skip: Might work with Qt 5.12 Scenario: Downloading a pdf via pdf.js button (issue 1214) Given pdfjs is available When I set content.pdfjs to true diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 2d3dfe1d1..75051ad44 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -737,15 +737,8 @@ Feature: Tab management # https://github.com/qutebrowser/qutebrowser/issues/2289 - @qtwebkit_skip @qt<5.9 - Scenario: Cloning a tab with a view-source URL - When I open / - And I open view-source:http://localhost:(port) - And I run :tab-clone - Then the error "Can't serialize special URL!" should be shown - - @qtwebkit_skip @qt>=5.9 - Scenario: Cloning a tab with a special URL (Qt 5.9) + @qtwebkit_skip + Scenario: Cloning a tab with a special URL When I open chrome://gpu And I run :tab-clone Then no crash should happen diff --git a/tests/helpers/utils.py b/tests/helpers/utils.py index ac0506856..97ac260fc 100644 --- a/tests/helpers/utils.py +++ b/tests/helpers/utils.py @@ -41,16 +41,8 @@ from qutebrowser.utils import qtutils, log ON_CI = 'CI' in os.environ -qt58 = pytest.mark.skipif( - qtutils.version_check('5.9'), reason="Needs Qt 5.8 or earlier") -qt59 = pytest.mark.skipif( - not qtutils.version_check('5.9'), reason="Needs Qt 5.9 or newer") -qt510 = pytest.mark.skipif( - not qtutils.version_check('5.10'), reason="Needs Qt 5.10 or newer") qt514 = pytest.mark.skipif( not qtutils.version_check('5.14'), reason="Needs Qt 5.14 or newer") -skip_qt511 = pytest.mark.skipif( - qtutils.version_check('5.11'), reason="Needs Qt 5.10 or earlier") class PartialCompareOutcome: diff --git a/tests/unit/browser/test_caret.py b/tests/unit/browser/test_caret.py index 75d9fee09..bfa718315 100644 --- a/tests/unit/browser/test_caret.py +++ b/tests/unit/browser/test_caret.py @@ -324,9 +324,6 @@ def test_drop_selection(caret, selection): class TestSearch: - # https://bugreports.qt.io/browse/QTBUG-60673 - - @pytest.mark.qtbug60673 @pytest.mark.no_xvfb def test_yanking_a_searched_line(self, caret, selection, mode_manager, web_tab, qtbot): mode_manager.leave(usertypes.KeyMode.caret) @@ -339,7 +336,6 @@ class TestSearch: caret.move_to_end_of_line() selection.check('five six') - @pytest.mark.qtbug60673 @pytest.mark.no_xvfb def test_yanking_a_searched_line_with_multiple_matches(self, caret, selection, mode_manager, web_tab, qtbot): mode_manager.leave(usertypes.KeyMode.caret) diff --git a/tests/unit/browser/webengine/test_webenginedownloads.py b/tests/unit/browser/webengine/test_webenginedownloads.py index 3a830bd58..c4cd5ef17 100644 --- a/tests/unit/browser/webengine/test_webenginedownloads.py +++ b/tests/unit/browser/webengine/test_webenginedownloads.py @@ -34,10 +34,8 @@ from helpers import utils ('foo - 1970-01-01T00:00:00.000Z', 'foo'), ('foo(a)', 'foo(a)'), ('foo1', 'foo1'), - pytest.param('foo%20bar', 'foo bar', marks=utils.qt58), - pytest.param('foo%2Fbar', 'bar', marks=utils.qt58), - pytest.param('foo%20bar', 'foo%20bar', marks=utils.qt59), - pytest.param('foo%2Fbar', 'foo%2Fbar', marks=utils.qt59), + ('foo%20bar', 'foo%20bar'), + ('foo%2Fbar', 'foo%2Fbar'), ]) def test_get_suggested_filename(path, expected): assert webenginedownloads._get_suggested_filename(path) == expected diff --git a/tests/unit/browser/webengine/test_webenginesettings.py b/tests/unit/browser/webengine/test_webenginesettings.py index 538eeb9fa..44d90ef3e 100644 --- a/tests/unit/browser/webengine/test_webenginesettings.py +++ b/tests/unit/browser/webengine/test_webenginesettings.py @@ -45,8 +45,6 @@ def test_big_cache_size(config_stub): assert profile.httpCacheMaximumSize() == 2 ** 31 - 1 -@pytest.mark.skipif( - not qtutils.version_check('5.8'), reason="Needs Qt 5.8 or newer") def test_non_existing_dict(config_stub, monkeypatch, message_mock, caplog): monkeypatch.setattr(webenginesettings.spell, 'local_filename', lambda _code: None) @@ -61,8 +59,6 @@ def test_non_existing_dict(config_stub, monkeypatch, message_mock, caplog): assert msg.text == expected -@pytest.mark.skipif( - not qtutils.version_check('5.8'), reason="Needs Qt 5.8 or newer") def test_existing_dict(config_stub, monkeypatch): monkeypatch.setattr(webenginesettings.spell, 'local_filename', lambda _code: 'en-US-8-0') @@ -74,8 +70,6 @@ def test_existing_dict(config_stub, monkeypatch): assert profile.spellCheckLanguages() == ['en-US-8-0'] -@pytest.mark.skipif( - not qtutils.version_check('5.8'), reason="Needs Qt 5.8 or newer") def test_spell_check_disabled(config_stub, monkeypatch): config_stub.val.spellcheck.languages = [] webenginesettings._update_settings('spellcheck.languages') diff --git a/tests/unit/browser/webkit/test_cache.py b/tests/unit/browser/webkit/test_cache.py index f0aaf226e..05bf3bb28 100644 --- a/tests/unit/browser/webkit/test_cache.py +++ b/tests/unit/browser/webkit/test_cache.py @@ -26,12 +26,6 @@ from qutebrowser.browser.webkit import cache from qutebrowser.utils import qtutils -pytestmark = pytest.mark.skipif( - qtutils.version_check('5.7.1', compiled=False) and - not qtutils.version_check('5.9', compiled=False), - reason="QNetworkDiskCache is broken on Qt 5.7.1 and 5.8") - - @pytest.fixture def disk_cache(tmpdir, config_stub): return cache.DiskCache(str(tmpdir)) diff --git a/tests/unit/config/test_qtargs.py b/tests/unit/config/test_qtargs.py index 48befd7ad..88c45d970 100644 --- a/tests/unit/config/test_qtargs.py +++ b/tests/unit/config/test_qtargs.py @@ -168,7 +168,6 @@ class TestQtArgs: args = qtargs.qt_args(parsed) assert ('--disable-gpu' in args) == added - @utils.qt59 @pytest.mark.parametrize('policy, arg', [ ('all-interfaces', None), @@ -369,7 +368,6 @@ class TestQtArgs: assert combined_flag in args assert overlay_flag not in args - @utils.qt510 def test_blink_settings(self, config_stub, monkeypatch, parser): from qutebrowser.browser.webengine import darkmode monkeypatch.setattr(qtargs.objects, 'backend', diff --git a/tests/unit/mainwindow/statusbar/test_url.py b/tests/unit/mainwindow/statusbar/test_url.py index 8bf71aff4..07bbf9832 100644 --- a/tests/unit/mainwindow/statusbar/test_url.py +++ b/tests/unit/mainwindow/statusbar/test_url.py @@ -47,10 +47,7 @@ def url_widget(qtbot, monkeypatch, config_stub): ('http://username:secret%20password@test.com', 'http://username@test.com'), ('http://example.com%5b/', '(invalid URL!) http://example.com%5b/'), # https://bugreports.qt.io/browse/QTBUG-60364 - pytest.param('http://www.xn--80ak6aa92e.com', - '(unparseable URL!) http://www.аррӏе.com', marks=utils.qt58), - pytest.param('http://www.xn--80ak6aa92e.com', - 'http://www.xn--80ak6aa92e.com', marks=utils.qt59), + ('http://www.xn--80ak6aa92e.com', 'http://www.xn--80ak6aa92e.com'), # IDN URL ('http://www.ä.com', '(www.xn--4ca.com) http://www.ä.com'), (None, ''), diff --git a/tests/unit/utils/test_urlutils.py b/tests/unit/utils/test_urlutils.py index df9d8b510..4cff8721b 100644 --- a/tests/unit/utils/test_urlutils.py +++ b/tests/unit/utils/test_urlutils.py @@ -702,12 +702,8 @@ def test_data_url(): (QUrl('http://www.example.xn--p1ai'), '(www.example.xn--p1ai) http://www.example.рф'), # https://bugreports.qt.io/browse/QTBUG-60364 - pytest.param(QUrl('http://www.xn--80ak6aa92e.com'), - '(unparseable URL!) http://www.аррӏе.com', - marks=testutils.qt58), - pytest.param(QUrl('http://www.xn--80ak6aa92e.com'), - 'http://www.xn--80ak6aa92e.com', - marks=testutils.qt59), + (QUrl('http://www.xn--80ak6aa92e.com'), + 'http://www.xn--80ak6aa92e.com'), ]) def test_safe_display_string(url, expected): assert urlutils.safe_display_string(url) == expected |