<!DOCTYPE html>
<html>
<body>
<script>
window.addEventListener("unload", (event) => {
    xhr = new XMLHttpRequest();
    xhr.open("GET", "/resources/dummy.xml", false);
    try {
        xhr.send(null);
        opener.testFailed("Doing a synchronous XHR in the unload event handler did not throw");
    } catch (e) {
        opener.testPassed("Doing a synchronous XHR in the unload event handler threw an exception");
    }
    opener.finishJSTest();
});
</script>
</body>
</html>
