chromium/third_party/blink/web_tests/http/tests/websocket/resources/close-on-unload-iframe-reference-in-parent.html

<html>
<head>
<script src="/js-test-resources/js-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
parent.document.childWebSocket = new WebSocket(parent.document.wsUrl);

parent.document.childWebSocket.onopen = function()
{
    // Send "socket1" to server, so that "socket1" will be broadcasted to
    // WebSockets connected to close-on-unload when this web socket is closed.
    parent.document.childWebSocket.send("socket1");
};
parent.document.childWebSocket.onmessage = function(evt)
{
    // "socket1" is received by server, so ready to unload this document.
    parent.document.iframeReady(evt.data);
};
</script>
</body>
</html>