diff options
author | Florian Bruhin <me@the-compiler.org> | 2019-07-05 23:00:13 +0200 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2019-07-06 17:29:55 +0200 |
commit | 8a0f031fe74708de8a172350f3aecc339e43fd58 (patch) | |
tree | 6c0f64cbbe01838f27fdd447959c98f23b68cff0 /tests/unit/browser/test_caret.py | |
parent | db64de78dbdec1ba948cf88917404478b3e56417 (diff) | |
download | qutebrowser-8a0f031fe74708de8a172350f3aecc339e43fd58.tar.gz qutebrowser-8a0f031fe74708de8a172350f3aecc339e43fd58.zip |
Expose view when searching on macOS/Windows with 5.13
Diffstat (limited to 'tests/unit/browser/test_caret.py')
-rw-r--r-- | tests/unit/browser/test_caret.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/unit/browser/test_caret.py b/tests/unit/browser/test_caret.py index a4e7fb2e6..90944032e 100644 --- a/tests/unit/browser/test_caret.py +++ b/tests/unit/browser/test_caret.py @@ -24,7 +24,7 @@ import textwrap import pytest from PyQt5.QtCore import QUrl -from qutebrowser.utils import usertypes +from qutebrowser.utils import utils, qtutils, usertypes @pytest.fixture @@ -287,12 +287,22 @@ def test_drop_selection(caret, selection): class TestSearch: + @pytest.fixture(autouse=True) + def expose(self, web_tab): + """Expose the web view if needed. + + With QtWebEngine 5.13 on macOS/Windows, searching fails (callback + called with False) when the view isn't exposed. + """ + if qtutils.version_check('5.13') and not utils.is_linux: + web_tab.container.expose() + web_tab.show() + # 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): - web_tab.show() mode_manager.leave(usertypes.KeyMode.caret) with qtbot.wait_callback() as callback: @@ -306,7 +316,6 @@ class TestSearch: @pytest.mark.qtbug60673 @pytest.mark.no_xvfb def test_yanking_a_searched_line_with_multiple_matches(self, caret, selection, mode_manager, web_tab, qtbot): - web_tab.show() mode_manager.leave(usertypes.KeyMode.caret) with qtbot.wait_callback() as callback: |