From ea2d5e97e2b7dd9ec787c6501daa7c3142980e2d Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 3 May 2017 21:31:09 +0200 Subject: [PATCH] Disable serialization crash check on Qt 5.9 --- qutebrowser/browser/webengine/webenginetab.py | 20 +++++++++---------- tests/end2end/features/tabs.feature | 8 +++++++- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/qutebrowser/browser/webengine/webenginetab.py b/qutebrowser/browser/webengine/webenginetab.py index cedd59b1e..00c205b73 100644 --- a/qutebrowser/browser/webengine/webenginetab.py +++ b/qutebrowser/browser/webengine/webenginetab.py @@ -378,16 +378,16 @@ class WebEngineHistory(browsertab.AbstractHistory): return self._history.canGoForward() def serialize(self): - # WORKAROUND (remove this when we bump the requirements to 5.9) - # https://bugreports.qt.io/browse/QTBUG-59599 - if self._history.count() == 0: - raise browsertab.WebTabError("Can't serialize page without " - "history!") - # WORKAROUND (FIXME: remove this when we bump the requirements to 5.9?) - # https://github.com/qutebrowser/qutebrowser/issues/2289 - scheme = self._history.currentItem().url().scheme() - if scheme in ['view-source', 'chrome']: - raise browsertab.WebTabError("Can't serialize special URL!") + if not qtutils.version_check('5.9'): + # WORKAROUND for https://bugreports.qt.io/browse/QTBUG-59599 + if self._history.count() == 0: + raise browsertab.WebTabError("Can't serialize page without " + "history!") + # WORKAROUND for + # https://github.com/qutebrowser/qutebrowser/issues/2289 + scheme = self._history.currentItem().url().scheme() + if scheme in ['view-source', 'chrome']: + raise browsertab.WebTabError("Can't serialize special URL!") return qtutils.serialize(self._history) def deserialize(self, data): diff --git a/tests/end2end/features/tabs.feature b/tests/end2end/features/tabs.feature index 5e571d42d..748360bc3 100644 --- a/tests/end2end/features/tabs.feature +++ b/tests/end2end/features/tabs.feature @@ -607,12 +607,18 @@ Feature: Tab management title: Test title # https://github.com/qutebrowser/qutebrowser/issues/2289 - @qtwebkit_skip @qt>=5.8 + @qtwebkit_skip @qt==5.8.0 Scenario: Cloning a tab with a special URL When I open chrome://gpu 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) + When I open chrome://gpu + And I run :tab-clone + Then no crash should happen + # :tab-detach Scenario: Detaching a tab