blob: 73f55c1cbbb6bba25adc73ea187fd867dd6fcfc5 [file] [log] [blame]
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function addElement() {
document.documentElement.appendChild(document.createTextNode('X'));
}
document.addEventListener("DOMContentLoaded", addElement, false);
window.onload = addElement;
var xhr = new XMLHttpRequest;
function sendXHR()
{
xhr.open("GET", "", true);
try {
xhr.send();
}
catch(e) {
// In case of reentrant call, the call to "open" will be aborted by reentrant call.
// The call to "send" following the "open" aborted call will throw an exception (XHR not in open mode)
if (e.name != "InvalidStateError") {
console.log("FAILED: Was expecting an InvalidStateError exception");
}
testRunner.notifyDone();
}
}
window.addEventListener("DOMSubtreeModified", sendXHR);
addElement();
</script>
This tests that when we re-entrantly create and cancel XHRs, we don't try to disconnect the same CachedResourceClient
multiple times from its CachedResource. We pass if we don't crash.