<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../../js-test-resources/js-test-pre.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
description("Test if it doesn't crash when reloading while Web Socket is busy");

window.jsTestIsAsync = true;

var frameDiv;
var reloadCount = 0;

document.iframeReady = function ()
{
    if (reloadCount == 0)
        debug("PASS iframe is ready.");
    else if (reloadCount == 1) {
        debug("PASS reloaded iframe while WebSocket is busy");
        finishJSTest();
    } else
        testFailed("iframe should not get reloaded more than once. (reloadCount = " + reloadCount + ")");
    return reloadCount++;
};

frameDiv = document.createElement("iframe");
frameDiv.src = "resources/reload-crash-iframe.html";
document.body.appendChild(frameDiv);
debug("PASS insert a iframe");

</script>
<script src="../../../../js-test-resources/js-test-post.js"></script>
</body>
</html>
