chromium/third_party/blink/web_tests/fast/dom/Window/post-message-to-self.html

<html>
<head>
<script src="../../../resources/js-test.js"></script>
</head>
<body>
<script>
description("Test that window.postMessage() to self is not leaking.");

window.jsTestIsAsync = true;

if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function postMessageToSelf() {
    setInterval(function() {
        window.postMessage("msg", "*");
    }, 1);
}

function receiveMessage(event) {
    testPassed("Received message " + event.data);
    finishJSTest();
}

window.addEventListener("message", receiveMessage, false);
postMessageToSelf();
</script>
</body>
</html