Trying to fix chrome crash when running tests

This commit is contained in:
Alexey Andreev 2019-08-21 12:27:27 +03:00
parent 0f9a71dc85
commit 846d3dc278
2 changed files with 3 additions and 2 deletions

View File

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

View File

@ -21,6 +21,5 @@
<script src="client.js"></script>
</head>
<body>
<iframe id="test" src="frame.html"></iframe>
</body>
</html>