Skip to content
  • jianli@chromium.org's avatar
    Support using FormData to send a sliced file via XHR. · d8be2d18
    jianli@chromium.org authored
    https://bugs.webkit.org/show_bug.cgi?id=36678
    
    Reviewed by Dmitry Titov.
    
    WebCore:
    
    Tests: http/tests/local/formdata/send-form-data-with-sliced-file.html
    
    * html/Blob.h:
    (WebCore::Blob::isFile):
    * html/DOMFormData.cpp:
    (WebCore::DOMFormData::append):
    * html/File.h:
    (WebCore::File::isFile):
    * html/FormDataList.h:
    (WebCore::FormDataList::appendBlob):
    (WebCore::FormDataList::Item::Item):
    (WebCore::FormDataList::Item::blob):
    * html/HTMLInputElement.cpp:
    (WebCore::HTMLInputElement::appendFormData):
    * platform/network/FormData.cpp:
    (WebCore::FormData::appendDOMFormData):
    * platform/network/mac/FormDataStreamMac.mm:
    (WebCore::closeCurrentStream):
    
    LayoutTests:
    
    Move common functionality to test sending FormData into a helper file
    so that it can be shared by FormData layout tests.
    Also move the form data testing files to a new subdirectory formdata/.
    
    * http/tests/local/formdata/resources/send-form-data-common.js: Added.
    * http/tests/local/formdata/script-tests/TEMPLATE.html: Added.
    * http/tests/local/formdata/script-tests/send-form-data-with-sliced-file.js: Added.
    * http/tests/local/formdata/script-tests/send-form-data.js: Added.
    * http/tests/local/formdata/send-form-data-expected.txt: Renamed from LayoutTests/http/tests/local/send-form-data-expected.txt.
    * http/tests/local/formdata/send-form-data-with-sliced-file-expected.txt: Added.
    * http/tests/local/formdata/send-form-data-with-sliced-file.html: Added.
    * http/tests/local/formdata/send-form-data.html: Added.
    * http/tests/local/resources/send-form-data.js: Removed.
    * http/tests/local/send-form-data.html: Removed.
    * platform/gtk/Skipped:
    * platform/qt/Skipped:
    * platform/win/Skipped:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d8be2d18