From d04534dc33564c6bcb91e990dcd2cc145a4d9c2b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 15 Nov 2016 07:02:32 +0100 Subject: [PATCH] Reenable @qtwebengine_createWindow tests Closes #2121 --- pytest.ini | 1 - qutebrowser/browser/webengine/webview.py | 1 + tests/end2end/conftest.py | 7 ------- tests/end2end/features/hints.feature | 7 ++----- tests/end2end/features/history.feature | 1 - tests/end2end/features/javascript.feature | 8 +------- tests/end2end/features/utilcmds.feature | 3 +-- 7 files changed, 5 insertions(+), 23 deletions(-) diff --git a/pytest.ini b/pytest.ini index 109e30fde..2285053a9 100644 --- a/pytest.ini +++ b/pytest.ini @@ -17,7 +17,6 @@ markers = qtwebengine_todo: Features still missing with QtWebEngine qtwebengine_skip: Tests not applicable with QtWebEngine qtwebkit_skip: Tests not applicable with QtWebKit - qtwebengine_createWindow: Tests using createWindow with QtWebEngine (QTBUG-54419) qtwebengine_flaky: Tests which are flaky (and currently skipped) with QtWebEngine qtwebengine_osx_xfail: Tests which fail on OS X with QtWebEngine js_prompt: Tests needing to display a javascript prompt diff --git a/qutebrowser/browser/webengine/webview.py b/qutebrowser/browser/webengine/webview.py index ffc9555f3..1c3a989b1 100644 --- a/qutebrowser/browser/webengine/webview.py +++ b/qutebrowser/browser/webengine/webview.py @@ -87,6 +87,7 @@ class WebEngineView(QWebEngineView): target = usertypes.ClickTarget.tab elif wintype == QWebEnginePage.WebBrowserTab: # Middle-click / Ctrl-Click with Shift + # FIXME:qtwebengine this also affects target=_blank links... if background_tabs: target = usertypes.ClickTarget.tab else: diff --git a/tests/end2end/conftest.py b/tests/end2end/conftest.py index 4914422fb..d2512457e 100644 --- a/tests/end2end/conftest.py +++ b/tests/end2end/conftest.py @@ -132,14 +132,7 @@ if not getattr(sys, 'frozen', False): def pytest_collection_modifyitems(config, items): """Apply @qtwebengine_* markers; skip unittests with QUTE_BDD_WEBENGINE.""" - vercheck = qtutils.version_check - qtbug_54419_fixed = ((vercheck('5.6.2') and not vercheck('5.7.0')) or - qtutils.version_check('5.7.1') or - os.environ.get('QUTE_QTBUG54419_PATCHED', '')) - markers = [ - ('qtwebengine_createWindow', 'Skipped because of QTBUG-54419', - pytest.mark.skipif, not qtbug_54419_fixed and config.webengine), ('qtwebengine_todo', 'QtWebEngine TODO', pytest.mark.xfail, config.webengine), ('qtwebengine_skip', 'Skipped with QtWebEngine', pytest.mark.skipif, diff --git a/tests/end2end/features/hints.feature b/tests/end2end/features/hints.feature index 2a8f6082e..b6db8b47a 100644 --- a/tests/end2end/features/hints.feature +++ b/tests/end2end/features/hints.feature @@ -22,7 +22,6 @@ Feature: Using hints ### Opening in current or new tab - @qtwebengine_createWindow Scenario: Following a hint and force to open in current tab. When I open data/hints/link_blank.html And I hint with args "links current" and follow a @@ -30,7 +29,7 @@ Feature: Using hints Then the following tabs should be open: - data/hello.txt (active) - @qtwebengine_createWindow + @qtwebengine_skip: Opens in background Scenario: Following a hint and allow to open in new tab. When I open data/hints/link_blank.html And I hint with args "links normal" and follow a @@ -39,7 +38,6 @@ Feature: Using hints - data/hints/link_blank.html - data/hello.txt (active) - @qtwebengine_createWindow Scenario: Following a hint to link with sub-element and force to open in current tab. When I open data/hints/link_span.html And I run :tab-close @@ -186,13 +184,12 @@ Feature: Using hints And I hint wht args "links normal" and follow a Then "navigation request: url http://localhost:*/data/hello2.txt, type NavigationTypeLinkClicked, *" should be logged - @qtwebengine_createWindow + @qtwebengine_skip: Opens in new tab due to Chromium bug Scenario: Opening a link inside a specific iframe When I open data/hints/iframe_target.html And I hint with args "links normal" and follow a Then "navigation request: url http://localhost:*/data/hello.txt, type NavigationTypeLinkClicked, *" should be logged - @qtwebengine_createWindow Scenario: Opening a link with specific target frame in a new tab When I open data/hints/iframe_target.html And I run :tab-only diff --git a/tests/end2end/features/history.feature b/tests/end2end/features/history.feature index 529cced46..05a896be2 100644 --- a/tests/end2end/features/history.feature +++ b/tests/end2end/features/history.feature @@ -48,7 +48,6 @@ Feature: Page history Then the history file should contain: http://localhost:(port)/status/404 Error loading page: http://localhost:(port)/status/404 - @qtwebengine_createWindow Scenario: History with invalid URL When I open data/javascript/window_open.html And I run :click-element id open-invalid diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index dda097f00..c6e71f4de 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -7,8 +7,6 @@ Feature: Javascript stuff And I open data/javascript/consolelog.html Then the javascript message "console.log works!" should be logged - # Causes segfaults... - @qtwebengine_createWindow Scenario: Opening/Closing a window via JS When I open data/javascript/window_open.html And I run :tab-only @@ -18,8 +16,6 @@ Feature: Javascript stuff And I run :click-element id close-normal Then "Focus object changed: *" should be logged - # Causes segfaults... - @qtwebengine_createWindow Scenario: Opening/closing a modal window via JS When I open data/javascript/window_open.html And I run :tab-only @@ -44,7 +40,7 @@ Feature: Javascript stuff And I run :click-element id close-twice Then "Requested to close * which does not exist!" should be logged - @qtwebengine_createWindow @qtwebkit_skip + @qtwebkit_skip Scenario: Closing a JS window twice (issue 906) - qtwebengine When I open about:blank And I run :tab-only @@ -56,7 +52,6 @@ Feature: Javascript stuff And I wait for "Focus object changed: *" in the log Then no crash should happen - @qtwebengine_createWindow Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to true When I open data/hello.txt And I set content -> javascript-can-open-windows-automatically to true @@ -64,7 +59,6 @@ Feature: Javascript stuff And I run :jseval if (window.open('about:blank')) { console.log('window opened'); } else { console.log('error while opening window'); } Then the javascript message "window opened" should be logged - @qtwebengine_createWindow Scenario: Opening window without user interaction with javascript-can-open-windows-automatically set to false When I open data/hello.txt And I set content -> javascript-can-open-windows-automatically to false diff --git a/tests/end2end/features/utilcmds.feature b/tests/end2end/features/utilcmds.feature index 5f58ced3c..22acabc0b 100644 --- a/tests/end2end/features/utilcmds.feature +++ b/tests/end2end/features/utilcmds.feature @@ -124,11 +124,10 @@ Feature: Miscellaneous utility commands exposed to the user. Then the page should not be scrolled And the error "prompt-accept: This command is only allowed in prompt/yesno mode, not normal." should be shown - @qtwebengine_createWindow Scenario: :repeat-command with mode-switching command When I open data/hints/link_blank.html And I run :tab-only - And I hint with args "all" + And I hint with args "all tab-fg" And I run :leave-mode And I run :repeat-command And I run :follow-hint a