mirror of
https://github.com/konsoletyper/teavm.git
synced 2024-11-21 01:00:54 +08:00
Trying to fix chrome crash when running tests
This commit is contained in:
parent
0f9a71dc85
commit
846d3dc278
@ -62,12 +62,14 @@ function runTests(ws, suiteId, tests, index) {
|
||||
|
||||
function runSingleTest(test, callback) {
|
||||
console.log("Running test " + test.name + " consisting of " + test.files);
|
||||
let iframe = document.getElementById("test");
|
||||
let iframe = document.createElement("iframe");
|
||||
document.body.appendChild(iframe);
|
||||
let handshakeListener = () => {
|
||||
window.removeEventListener("message", handshakeListener);
|
||||
|
||||
let listener = event => {
|
||||
window.removeEventListener("message", listener);
|
||||
document.body.removeChild(iframe);
|
||||
callback(event.data);
|
||||
};
|
||||
window.addEventListener("message", listener);
|
||||
|
@ -21,6 +21,5 @@
|
||||
<script src="client.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<iframe id="test" src="frame.html"></iframe>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user