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

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: 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..8c177712aed500ba8b826a1800c19dc96f689e3f 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,15 @@ 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.
+ if ((num != 0 && this.readyState == num) ||
tyoshino (SeeGerritForStatus) 2016/11/22 08:46:54 shouldn't this be num != XMLHttpRequest.DONE && t
sof 2016/11/22 08:58:33 It would be unnatural & unwanted for there to be a
tyoshino (SeeGerritForStatus) 2016/11/22 09:29:53 Got it. But this would log PASS when num is XMLHtt
sof 2016/11/22 10:14:14 I've teased apart the testing of the pass conditio
tyoshino (SeeGerritForStatus) 2016/11/22 11:18:32 Yes. Thanks!
+ (num == XMLHttpRequest.DONE && this.readyState == 0))
log("PASS");
else
log("FAILED");
}
-
+
if (finishedTests == abortToDo.length && window.testRunner)
testRunner.notifyDone();
}

Powered by Google App Engine
This is Rietveld 408576698