Source/WebCore: Should fire error event for empty 404 script
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 22:08:53 +0000 (22:08 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Jun 2012 22:08:53 +0000 (22:08 +0000)
commit14258e83fe3c9b90f836c8373872faa112f07710
treec1cc548db4d7586887e153369743dbeb6a096711
parent9a75b3b8a2e2d47b97bb6b1fc3475aee65758824
Source/WebCore: Should fire error event for empty 404 script
https://bugs.webkit.org/show_bug.cgi?id=50589

Patch by Edaena Salinas Jasso <edaena@apple.com> on 2012-06-07
Reviewed by Brady Eidson.

Tests:
http/tests/loading/fire-error-event-empty-404-script.html
http/tests/loading/fire-error-script-no-content-type.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): We should check for http status
codes here to stop depending on the response being non-empty.
(WebCore::SubresourceLoader::didReceiveData): Moved the http status check but
avoid messing with multipart responses.
(WebCore::SubresourceLoader::checkForHTTPStatusCodeError): Renamed from
errorLoadingResource for clarity.

* loader/SubresourceLoader.h:
* loader/cf/SubresourceLoaderCF.cpp:
(WebCore::SubresourceLoader::didReceiveDataArray):
Updated for errorLoadingResource renaming.

LayoutTests: Should fire error event for empty 404 script
https://bugs.webkit.org/show_bug.cgi?id=50589

Patch by Edaena Salinas Jasso <edaena@apple.com> on 2012-06-07
Reviewed by Brady Eidson.

Based on a test by Ojan Vafai.

* http/tests/loading/fire-error-event-empty-404-script-expected.txt: Added.
* http/tests/loading/fire-error-event-empty-404-script.html: Added.
* http/tests/loading/fire-error-event-script-no-content-type-expected.txt: Added.
* http/tests/loading/fire-error-event-script-no-content-type.html: Added.
* http/tests/loading/resources/404-with-empty-body-no-content-type.cgi: Added.
* http/tests/loading/resources/404-with-empty-body.cgi: Added.
* http/tests/resources/network-simulator.php: Fixed to no longer return 404 error
when logging a request.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/loading/fire-error-event-empty-404-script-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/fire-error-event-empty-404-script.html [new file with mode: 0644]
LayoutTests/http/tests/loading/fire-error-event-script-no-content-type-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/loading/fire-error-event-script-no-content-type.html [new file with mode: 0644]
LayoutTests/http/tests/loading/resources/404-with-empty-body-no-content-type.cgi [new file with mode: 0755]
LayoutTests/http/tests/loading/resources/404-with-empty-body.cgi [new file with mode: 0755]
LayoutTests/http/tests/resources/network-simulator.php
Source/WebCore/ChangeLog
Source/WebCore/loader/SubresourceLoader.cpp
Source/WebCore/loader/SubresourceLoader.h
Source/WebCore/loader/cf/SubresourceLoaderCF.cpp