Dispatch a progress event before dispatching abort, error or timeout event
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jan 2014 18:41:17 +0000 (18:41 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Jan 2014 18:41:17 +0000 (18:41 +0000)
commite923d1e25ff4c684543afd18928f162e133d94e8
tree5bec500462a543944b904426783897a24520d4fd
parenta58ae86a3caf0563620a6ce54f5b8620f1dc5c2a
Dispatch a progress event before dispatching abort, error or timeout event
https://bugs.webkit.org/show_bug.cgi?id=126575

Source/WebCore:

Patch by Youenn Fablet <youennf@gmail.com> on 2014-01-13
Reviewed by Alexey Proskuryakov.

Added sending of progress event after readystatechange event (switching to DONE state) in case of abort, error or timeout.
Fixed assertions in XMLHttpRequestProgressEventThrottle and XMLHttpRequestUpload.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::dispatchErrorEvents): added sending of progress event before the specific error event
* xml/XMLHttpRequestProgressEventThrottle.cpp:
(WebCore::XMLHttpRequestProgressEventThrottle::dispatchProgressEvent): fixed assertion
* xml/XMLHttpRequestUpload.cpp:
(WebCore::XMLHttpRequestUpload::dispatchProgressEvent): fixed assertion

LayoutTests:

Patch by Youenn Fablet <youennf@gmail.com> on 2014-01-13
Reviewed by Alexey Proskuryakov.

Updated onloadend-event-after-abort.html and onloadend-event-after-error.html to check for progress event.
Fixed the other tests to cope with additional progress event.

* http/tests/xmlhttprequest/onabort-progressevent-attributes.html:
* http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt:
* http/tests/xmlhttprequest/onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt:
* http/tests/xmlhttprequest/onloadend-event-after-error.html:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt:
* http/tests/xmlhttprequest/simple-cross-origin-progress-events.html:
* http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html:
* http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@161891 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/xmlhttprequest/onabort-progressevent-attributes.html
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort-expected.txt
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-abort.html
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error-expected.txt
LayoutTests/http/tests/xmlhttprequest/onloadend-event-after-error.html
LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events-expected.txt
LayoutTests/http/tests/xmlhttprequest/simple-cross-origin-progress-events.html
LayoutTests/http/tests/xmlhttprequest/upload-onloadend-event-after-abort.html
LayoutTests/http/tests/xmlhttprequest/xmlhttprequest-sync-no-progress-events-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/xml/XMLHttpRequest.cpp
Source/WebCore/xml/XMLHttpRequestProgressEventThrottle.cpp
Source/WebCore/xml/XMLHttpRequestUpload.cpp