[Fetch API] Implement fetch skeleton
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2016 09:46:27 +0000 (09:46 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2016 09:46:27 +0000 (09:46 +0000)
commitd8860dc1a6411952c089732a43e049b6e988b51a
treeea86e46deeb1d548373da3f9c9f4d2732ccd9861
parentaa89440da97b1aeb8620b18f6c979e2fe3452434
[Fetch API] Implement fetch skeleton
https://bugs.webkit.org/show_bug.cgi?id=155111

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Importing basic fetch api tests.

* resources/ImportExpectations: Activating fetch/api/basic import.
* web-platform-tests/fetch/api/basic/accept-header-expected.txt: Added.
* web-platform-tests/fetch/api/basic/accept-header-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/accept-header-worker.html: Added.
* web-platform-tests/fetch/api/basic/accept-header.html: Added.
* web-platform-tests/fetch/api/basic/accept-header.js: Added.
(promise_test):
* web-platform-tests/fetch/api/basic/integrity-expected.txt: Added.
* web-platform-tests/fetch/api/basic/integrity-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/integrity-worker.html: Added.
* web-platform-tests/fetch/api/basic/integrity.html: Added.
* web-platform-tests/fetch/api/basic/integrity.js: Added.
(integrity):
* web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt: Added.
* web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/mode-no-cors-worker.html: Added.
* web-platform-tests/fetch/api/basic/mode-no-cors.html: Added.
* web-platform-tests/fetch/api/basic/mode-no-cors.js: Added.
(fetchNoCors):
* web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt: Added.
* web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/mode-same-origin-worker.html: Added.
* web-platform-tests/fetch/api/basic/mode-same-origin.html: Added.
* web-platform-tests/fetch/api/basic/mode-same-origin.js: Added.
(fetchSameOrigin):
* web-platform-tests/fetch/api/basic/request-forbidden-headers-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-forbidden-headers-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-forbidden-headers-worker.html: Added.
* web-platform-tests/fetch/api/basic/request-forbidden-headers.html: Added.
* web-platform-tests/fetch/api/basic/request-forbidden-headers.js: Added.
(requestForbiddenHeaders):
* web-platform-tests/fetch/api/basic/request-headers-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/request-headers-worker.html: Added.
* web-platform-tests/fetch/api/basic/request-headers.html: Added.
* web-platform-tests/fetch/api/basic/request-headers.js: Added.
(requestHeaders):
* web-platform-tests/fetch/api/basic/scheme-about-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-about-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-about-worker.html: Added.
* web-platform-tests/fetch/api/basic/scheme-about.html: Added.
* web-platform-tests/fetch/api/basic/scheme-about.js: Added.
(checkFetchResponse):
(checkKoUrl):
* web-platform-tests/fetch/api/basic/scheme-blob-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-blob-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-blob-worker.html: Added.
* web-platform-tests/fetch/api/basic/scheme-blob.html: Added.
* web-platform-tests/fetch/api/basic/scheme-blob.js: Added.
(checkFetchResponse):
(checkKoUrl):
* web-platform-tests/fetch/api/basic/scheme-data-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-data-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-data-worker.html: Added.
* web-platform-tests/fetch/api/basic/scheme-data.html: Added.
* web-platform-tests/fetch/api/basic/scheme-data.js: Added.
(checkFetchResponse):
(checkKoUrl):
* web-platform-tests/fetch/api/basic/scheme-others-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-others-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/scheme-others-worker.html: Added.
* web-platform-tests/fetch/api/basic/scheme-others.html: Added.
* web-platform-tests/fetch/api/basic/scheme-others.js: Added.
(checkKoUrl):
* web-platform-tests/fetch/api/basic/stream-response-expected.txt: Added.
* web-platform-tests/fetch/api/basic/stream-response-worker-expected.txt: Added.
* web-platform-tests/fetch/api/basic/stream-response-worker.html: Added.
* web-platform-tests/fetch/api/basic/stream-response.html: Added.
* web-platform-tests/fetch/api/basic/stream-response.js: Added.
(streamBody):
(promise_test.):
(promise_test):
* web-platform-tests/fetch/api/basic/w3c-import.log: Added.

Source/WebCore:

Adding skeleton code to call fetch API from normal and worker scopes.
Fetch API implementation is limited to reject the promise.

Updating the binding generator to fix the case of overloaded promise-returning functions.
Made overloaded utility functions "static inline".

Tests: imported/w3c/web-platform-tests/fetch/api/basic/accept-header-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html
       imported/w3c/web-platform-tests/fetch/api/basic/integrity-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/integrity.html
       imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.html
       imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html
       imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.html
       imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-data-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-data.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-others-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/scheme-others.html
       imported/w3c/web-platform-tests/fetch/api/basic/stream-response-worker.html
       imported/w3c/web-platform-tests/fetch/api/basic/stream-response.html

* CMakeLists.txt:
* DerivedSources.make:
* Modules/fetch/DOMWindowFetch.cpp: Added.
(WebCore::DOMWindowFetch::fetch):
* Modules/fetch/DOMWindowFetch.h: Added.
* Modules/fetch/DOMWindowFetch.idl: Added.
* Modules/fetch/WorkerGlobalScopeFetch.cpp: Added.
(WebCore::WorkerGlobalScopeFetch::fetch):
* Modules/fetch/WorkerGlobalScopeFetch.h: Added.
* Modules/fetch/WorkerGlobalScopeFetch.idl: Added.
* WebCore.xcodeproj/project.pbxproj:
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation): Fixing the case of overloaded promise-returning functions.
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod2):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod3):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod4):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod5):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod6):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod7):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod8):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod9):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod10):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod11):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter1):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethodWithOptionalParameter2):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod11):
(WebCore::jsTestObjConstructorFunctionOverloadedMethod12):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
(WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction):
(WebCore::jsTestObjPrototypeFunctionOverloadedMethod): Deleted.
(WebCore::jsTestObjConstructorFunctionClassMethod2): Deleted.
(WebCore::jsTestObjPrototypeFunctionAny): Deleted.
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise): Deleted.
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise): Deleted.
(WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise): Deleted.
* bindings/scripts/test/TestObj.idl:

LayoutTests:

* TestExpectations: Marking some tests as flaky.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@197748 268f45cc-cd09-0410-ab3c-d52691b4dbfc
73 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/resources/ImportExpectations
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/accept-header.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/integrity.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-no-cors.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/mode-same-origin.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-forbidden-headers.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-blob.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-data.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-others-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-others-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-others-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-others.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/scheme-others.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response-worker-expected.txt [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response-worker.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response.html [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/stream-response.js [new file with mode: 0644]
LayoutTests/imported/w3c/web-platform-tests/fetch/api/basic/w3c-import.log [new file with mode: 0644]
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/fetch/DOMWindowFetch.cpp [new file with mode: 0644]
Source/WebCore/Modules/fetch/DOMWindowFetch.h [new file with mode: 0644]
Source/WebCore/Modules/fetch/DOMWindowFetch.idl [new file with mode: 0644]
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.cpp [new file with mode: 0644]
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.h [new file with mode: 0644]
Source/WebCore/Modules/fetch/WorkerGlobalScopeFetch.idl [new file with mode: 0644]
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
Source/WebCore/bindings/scripts/test/TestObj.idl