Improve window_open.html tests
This commit is contained in:
parent
91ca7d0911
commit
d4ea1df232
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
<head>
|
<head>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var my_window;
|
let my_window;
|
||||||
|
|
||||||
function open_modal() {
|
function open_modal() {
|
||||||
window.open('about:blank', 'window', 'modal');
|
my_window = window.open('about:blank', 'window', 'modal');
|
||||||
}
|
}
|
||||||
|
|
||||||
function open_normal() {
|
function open_normal() {
|
||||||
@ -19,11 +19,13 @@
|
|||||||
|
|
||||||
function close_normal() {
|
function close_normal() {
|
||||||
my_window.close();
|
my_window.close();
|
||||||
|
console.log("window closed");
|
||||||
}
|
}
|
||||||
|
|
||||||
function close_twice() {
|
function close_twice() {
|
||||||
my_window.close();
|
my_window.close();
|
||||||
my_window.close();
|
my_window.close();
|
||||||
|
console.log("window closed");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -15,7 +15,10 @@ Feature: Javascript stuff
|
|||||||
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
||||||
And I run :tab-focus 1
|
And I run :tab-focus 1
|
||||||
And I run :click-element id close-normal
|
And I run :click-element id close-normal
|
||||||
|
And I wait for "[*] window closed" in the log
|
||||||
Then "Focus object changed: *" should be logged
|
Then "Focus object changed: *" should be logged
|
||||||
|
And the following tabs should be open:
|
||||||
|
- data/javascript/window_open.html (active)
|
||||||
|
|
||||||
@qtwebkit_skip
|
@qtwebkit_skip
|
||||||
Scenario: Opening/closing a modal window via JS
|
Scenario: Opening/closing a modal window via JS
|
||||||
@ -25,8 +28,11 @@ Feature: Javascript stuff
|
|||||||
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
And I wait for "Changing title for idx 1 to 'about:blank'" in the log
|
||||||
And I run :tab-focus 1
|
And I run :tab-focus 1
|
||||||
And I run :click-element id close-normal
|
And I run :click-element id close-normal
|
||||||
|
And I wait for "[*] window closed" in the log
|
||||||
Then "Focus object changed: *" should be logged
|
Then "Focus object changed: *" should be logged
|
||||||
And "Web*Dialog requested, but we don't support that!" should be logged
|
And "Web*Dialog requested, but we don't support that!" should be logged
|
||||||
|
And the following tabs should be open:
|
||||||
|
- data/javascript/window_open.html (active)
|
||||||
|
|
||||||
# https://github.com/qutebrowser/qutebrowser/issues/906
|
# https://github.com/qutebrowser/qutebrowser/issues/906
|
||||||
|
|
||||||
@ -39,6 +45,7 @@ Feature: Javascript stuff
|
|||||||
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-twice
|
And I run :click-element id close-twice
|
||||||
|
And I wait for "[*] window closed" in the log
|
||||||
Then "Requested to close * which does not exist!" should be logged
|
Then "Requested to close * which does not exist!" should be logged
|
||||||
|
|
||||||
@qtwebkit_skip @flaky
|
@qtwebkit_skip @flaky
|
||||||
@ -51,6 +58,7 @@ Feature: Javascript stuff
|
|||||||
And I run :buffer window_open.html
|
And I run :buffer window_open.html
|
||||||
And I run :click-element id close-twice
|
And I run :click-element id close-twice
|
||||||
And I wait for "Focus object changed: *" in the log
|
And I wait for "Focus object changed: *" in the log
|
||||||
|
And I wait for "[*] window closed" in the log
|
||||||
Then no crash should happen
|
Then no crash should happen
|
||||||
|
|
||||||
@flaky
|
@flaky
|
||||||
|
Loading…
Reference in New Issue
Block a user