old qt: Remove conditional and old tests

This commit is contained in:
Florian Bruhin 2020-11-03 14:00:36 +01:00
parent 5e79574f70
commit 160831c5bd
18 changed files with 14 additions and 176 deletions

View File

@ -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

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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)

View File

@ -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

View File

@ -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')

View File

@ -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))

View File

@ -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',

View File

@ -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, ''),

View File

@ -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