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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html

Issue 2517173002: XMLHttpRequest.abort(): follow spec wrt readyState transitions. (Closed)
Patch Set: fix pass test predicate Created 4 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: third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html
index ff4b711af0ab4c518597372f7fe4b1d647c01ba9..d753930049600435e2df9b3608f734da07487cb0 100644
--- a/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html
+++ b/third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-abort-readyState-shouldNotDispatchEvent.html
@@ -37,12 +37,20 @@ function testAbortDoNotDispatchEvent(num)
++finishedTests;
this.onreadystatechange = catchReadystateEventAbort;
this.abort();
- if (this.readyState == 0)
+ // Following https://github.com/whatwg/xhr/issues/54, abort() should
+ // set readyState to UNSENT only when it (readyState) is DONE.
+ var pass;
+ if (num == XMLHttpRequest.DONE)
+ pass = this.readyState == XMLHttpRequest.UNSENT;
+ else
+ pass = this.readyState == num;
+
+ if (pass)
log("PASS");
else
log("FAILED");
}
-
+
if (finishedTests == abortToDo.length && window.testRunner)
testRunner.notifyDone();
}

Powered by Google App Engine
This is Rietveld 408576698