Add a container around webkit_tab
This makes the selection appear properly in caret tests - otherwise, --no-xvfb would be needed.
This commit is contained in:
parent
5978605873
commit
7cb32dca07
@ -157,9 +157,22 @@ def webkit_tab(qtbot, tab_registry, cookiejar_and_cache, mode_manager,
|
|||||||
session_manager_stub, greasemonkey_manager, fake_args,
|
session_manager_stub, greasemonkey_manager, fake_args,
|
||||||
host_blocker_stub):
|
host_blocker_stub):
|
||||||
webkittab = pytest.importorskip('qutebrowser.browser.webkit.webkittab')
|
webkittab = pytest.importorskip('qutebrowser.browser.webkit.webkittab')
|
||||||
|
|
||||||
|
container = QWidget()
|
||||||
|
qtbot.add_widget(container)
|
||||||
|
|
||||||
|
vbox = QVBoxLayout(container)
|
||||||
tab = webkittab.WebKitTab(win_id=0, mode_manager=mode_manager,
|
tab = webkittab.WebKitTab(win_id=0, mode_manager=mode_manager,
|
||||||
private=False)
|
private=False)
|
||||||
qtbot.add_widget(tab)
|
vbox.addWidget(tab)
|
||||||
|
# to make sure container isn't GCed
|
||||||
|
# pylint: disable=attribute-defined-outside-init
|
||||||
|
tab.container = container
|
||||||
|
# pylint: enable=attribute-defined-outside-init
|
||||||
|
|
||||||
|
with qtbot.waitExposed(container):
|
||||||
|
container.show()
|
||||||
|
|
||||||
return tab
|
return tab
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user