Skip to content

Commit 206497b

Browse files
committed
test, bugfix: sometimes closed events cannot be triggered.
1 parent f6ba544 commit 206497b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

test/gui_test.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ var html = `<html>
1818
if(first)
1919
{
2020
first = false;
21-
setTimeout(function() {
22-
external.postMessage('try close');
23-
}, 10);
21+
external.postMessage('try close');
2422
return false;
2523
}
2624
}
@@ -57,14 +55,14 @@ if (win) {
5755

5856
if (m === 'try close') {
5957
win.close();
60-
win = undefined;
6158
} else {
6259
win.close();
6360
}
6461
};
6562

6663
win.onclosed = () => {
6764
closed = true;
65+
win = undefined;
6866
};
6967

7068
win.onload = () => {

0 commit comments

Comments
 (0)