| Index: LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html
|
| diff --git a/LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html b/LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ae8cd55dbe5f544ef95efcab044b6d81e75dcf45
|
| --- /dev/null
|
| +++ b/LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html
|
| @@ -0,0 +1,52 @@
|
| +<!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>
|
|
|