Add some (crashing...) window.open/.close tests

This commit is contained in:
Florian Bruhin 2016-09-05 14:34:52 +02:00
parent cf89204ac3
commit ce98d89352
3 changed files with 42 additions and 6 deletions

View File

@ -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() {

View File

@ -3,20 +3,32 @@
<head>
<script type="text/javascript">
var my_window;
function open_modal() {
if (window.showModalDialog) {
window.showModalDialog();
} else {
window.open('hello.txt', 'window', 'modal');
window.open('about:blank', 'window', 'modal');
}
}
function open_normal() {
my_window = window.open('about:blank', 'my_window');
}
function close() {
my_window.close();
}
</script>
</head>
<body>
<button onclick="window.open('hello.txt', 'window')" id="open-normal">normal</button>
<button onclick="open_normal()" id="open-normal">normal</button>
<button onclick="open_modal()" id="open-modal">modal</button>
<button onclick="close()" id="close-normal">close</button>
<button onclick="close_twice()" id="close-twice">close twice (issue 906)</button>
</body>
</html>

View File

@ -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