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(); |
} |