Add some (crashing...) window.open/.close tests
This commit is contained in:
parent
cf89204ac3
commit
ce98d89352
@ -9,7 +9,7 @@
|
|||||||
var myWindow;
|
var myWindow;
|
||||||
|
|
||||||
function openWin() {
|
function openWin() {
|
||||||
myWindow = window.open("", "myWindow", "width=200, height=100");
|
myWindow = window.open("about:blank", "myWindow", "width=200, height=100");
|
||||||
}
|
}
|
||||||
|
|
||||||
function closeWin() {
|
function closeWin() {
|
||||||
|
@ -3,20 +3,32 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
var my_window;
|
||||||
|
|
||||||
function open_modal() {
|
function open_modal() {
|
||||||
if (window.showModalDialog) {
|
if (window.showModalDialog) {
|
||||||
window.showModalDialog();
|
window.showModalDialog();
|
||||||
} else {
|
} 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>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<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="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>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -7,22 +7,46 @@ Feature: Javascript stuff
|
|||||||
And I open data/javascript/consolelog.html
|
And I open data/javascript/consolelog.html
|
||||||
Then the javascript message "console.log works!" should be logged
|
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
|
# https://github.com/The-Compiler/qutebrowser/issues/906
|
||||||
|
|
||||||
@qtwebengine_skip
|
@qtwebengine_skip
|
||||||
Scenario: Closing a JS window twice (issue 906) - qtwebkit
|
Scenario: Closing a JS window twice (issue 906) - qtwebkit
|
||||||
When I open about:blank
|
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 run :click-element id open-button
|
||||||
And I wait for "Changing title for idx 2 to 'about:blank'" in the log
|
And I wait for "Changing title for idx 2 to 'about:blank'" in the log
|
||||||
And I run :tab-focus 2
|
And I run :tab-focus 2
|
||||||
And I run :click-element id close-button
|
And I run :click-element id close-button
|
||||||
Then "Requested to close * which does not exist!" should be logged
|
Then "Requested to close * which does not exist!" should be logged
|
||||||
|
|
||||||
@qtwebkit_skip
|
@qtwebengine_createWindow @qtwebkit_skip
|
||||||
@qtwebengine_createWindow
|
|
||||||
Scenario: Closing a JS window twice (issue 906) - qtwebengine
|
Scenario: Closing a JS window twice (issue 906) - qtwebengine
|
||||||
When I open about:blank
|
When I open about:blank
|
||||||
|
And I run :tab-only
|
||||||
And I open data/javascript/issue906.html in a new tab
|
And I open data/javascript/issue906.html in a new tab
|
||||||
And I run :click-element id open-button
|
And I run :click-element id open-button
|
||||||
And I wait for "WebDialog requested, but we don't support that!" in the log
|
And I wait for "WebDialog requested, but we don't support that!" in the log
|
||||||
|
Loading…
Reference in New Issue
Block a user