Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Unified Diff: LayoutTests/http/tests/xmlhttprequest/reentrant-cancel-abort.html

Issue 76133002: XHR: reset error flag on aborting request that restarts. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698