chromium/third_party/blink/web_tests/http/tests/xmlhttprequest/reentrant-cancel-abort.html

<!doctype html>
<html>
<body>
<script>
if (window.testRunner) {
    testRunner.dumpAsText();
    testRunner.waitUntilDone();
}

function log(str)
{
    document.body.appendChild(document.createTextNode(str));
    document.body.appendChild(document.createElement("br"));
}

function addElement(e)
{
    var txt = (e && e.type) || "insertedText";
    log(txt);
}
document.addEventListener("DOMContentLoaded", addElement, false);

var abortDispatched = false;
function reportResult()
{
    log(abortDispatched ? "PASS" : "FAIL");
    testRunner.notifyDone();
}

window.onload = function () {
    xhr.open("GET", "", true);
    setTimeout(reportResult, 100);
};

var xhr = new XMLHttpRequest();
xhr.onabort = function () {
    abortDispatched = true;
};

function sendAndAbort()
{
    xhr.open("GET", "", true);
    xhr.send();
    xhr.abort();
}
window.addEventListener("DOMSubtreeModified", sendAndAbort);
addElement();
</script>
Reentrancy, cancellation and explicit abort. Check that we don't crash
and report the expected abort event.<br/>
</body>
</html>