summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy <jimmy@spalge.com>2019-06-03 13:49:02 +1200
committerFlorian Bruhin <me@the-compiler.org>2019-06-10 11:46:22 +0200
commit19b39a098ae790d044d33f60c8a41104709aaa2e (patch)
tree09a2d419dc1be2c58e1637e61ace2cec3f74a230
parent8379ce9c841d547828b4c1cd668574d77a450f32 (diff)
downloadqutebrowser-19b39a098ae790d044d33f60c8a41104709aaa2e.tar.gz
qutebrowser-19b39a098ae790d044d33f60c8a41104709aaa2e.zip
Disable error pages in webpage fixture.
Due to a [change][] in webkit that introduced a default error page the the webkit/test_tabhistory.py::test_titles broke with the active tab because network access is disable in the webpage fixture. This change disables the default error pages in the fixture by telling the error notify thing that it doesn't support doing anything with the errors. It also disables the `ChooseMultipleFilesExtension` which should be used with this fixture since we override that for real in qutebrowser I'm declaring the class inside the method because I don't know how to skip declaring a class in stubs.py with importskip. change: https://github.com/annulen/webkit/commit/3b3724183bbe
-rw-r--r--tests/helpers/fixtures.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/helpers/fixtures.py b/tests/helpers/fixtures.py
index e50220c51..10fc4702f 100644
--- a/tests/helpers/fixtures.py
+++ b/tests/helpers/fixtures.py
@@ -428,7 +428,15 @@ def webengineview(qtbot, monkeypatch, web_tab_setup):
def webpage(qnam):
"""Get a new QWebPage object."""
QtWebKitWidgets = pytest.importorskip('PyQt5.QtWebKitWidgets')
- page = QtWebKitWidgets.QWebPage()
+ class WebPageStub(QtWebKitWidgets.QWebPage):
+
+ """QWebPage with default error pages disabled."""
+
+ def supportsExtension(self, _ext):
+ """No extensions needed."""
+ return False
+
+ page = WebPageStub()
page.networkAccessManager().deleteLater()
page.setNetworkAccessManager(qnam)
return page