From ce98d893520c493b189c82db15735d997aa81433 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 5 Sep 2016 14:34:52 +0200 Subject: [PATCH] Add some (crashing...) window.open/.close tests --- tests/end2end/data/javascript/issue906.html | 2 +- .../end2end/data/javascript/window_open.html | 16 ++++++++-- tests/end2end/features/javascript.feature | 30 +++++++++++++++++-- 3 files changed, 42 insertions(+), 6 deletions(-) diff --git a/tests/end2end/data/javascript/issue906.html b/tests/end2end/data/javascript/issue906.html index dbbf54ee9..ec2e0041b 100644 --- a/tests/end2end/data/javascript/issue906.html +++ b/tests/end2end/data/javascript/issue906.html @@ -9,7 +9,7 @@ var myWindow; function openWin() { - myWindow = window.open("", "myWindow", "width=200, height=100"); + myWindow = window.open("about:blank", "myWindow", "width=200, height=100"); } function closeWin() { diff --git a/tests/end2end/data/javascript/window_open.html b/tests/end2end/data/javascript/window_open.html index 9e217f57d..9e0f2ca8a 100644 --- a/tests/end2end/data/javascript/window_open.html +++ b/tests/end2end/data/javascript/window_open.html @@ -3,20 +3,32 @@ - + + + diff --git a/tests/end2end/features/javascript.feature b/tests/end2end/features/javascript.feature index b2273cb1d..d7b3b4d89 100644 --- a/tests/end2end/features/javascript.feature +++ b/tests/end2end/features/javascript.feature @@ -7,22 +7,46 @@ Feature: Javascript stuff And I open data/javascript/consolelog.html Then the javascript message "console.log works!" should be logged + # Causes segfaults... + @qtwebengine_createWindow @xfail_norun + Scenario: Opening/Closing a window via JS + When I open data/javascript/window_open.html + And I run :tab-only + And I run :click-element id open-normal + And I wait for "Changing title for idx 1 to 'about:blank'" in the log + And I run :tab-focus 1 + And I run :click-element id close-normal + Then "Focus object changed: *" should be logged + + # Causes segfaults... + @qtwebengine_createWindow @xfail_norun + Scenario: Opening/closing a modal window via JS + When I open data/javascript/window_open.html + And I run :tab-only + And I run :click-element id open-modal + And I wait for "Changing title for idx 1 to 'about:blank'" in the log + And I run :tab-focus 1 + And I run :click-element id close-normal + Then "Focus object changed: *" should be logged + And "WebModalDialog requested, but we don't support that!" should be logged + # https://github.com/The-Compiler/qutebrowser/issues/906 @qtwebengine_skip Scenario: Closing a JS window twice (issue 906) - qtwebkit When I open about:blank - And I open data/javascript/issue906.html in a new tab + And I run :tab-only + When I open data/javascript/issue906.html in a new tab And I run :click-element id open-button And I wait for "Changing title for idx 2 to 'about:blank'" in the log And I run :tab-focus 2 And I run :click-element id close-button Then "Requested to close * which does not exist!" should be logged - @qtwebkit_skip - @qtwebengine_createWindow + @qtwebengine_createWindow @qtwebkit_skip Scenario: Closing a JS window twice (issue 906) - qtwebengine When I open about:blank + And I run :tab-only And I open data/javascript/issue906.html in a new tab And I run :click-element id open-button And I wait for "WebDialog requested, but we don't support that!" in the log