Changeset 279969 in webkit


Ignore:
Timestamp:
Jul 15, 2021 4:24:52 PM (12 months ago)
Author:
Chris Dumez
Message:

FetchResponse.formData() should reject promise with a TypeError if the body is null
https://bugs.webkit.org/show_bug.cgi?id=228007

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Rebaseline WPT tests now that more checks are passing.

  • web-platform-tests/fetch/api/request/request-consume-empty.any-expected.txt:
  • web-platform-tests/fetch/api/request/request-consume-empty.any.worker-expected.txt:
  • web-platform-tests/fetch/api/response/response-consume-empty.any-expected.txt:
  • web-platform-tests/fetch/api/response/response-consume-empty.any.worker-expected.txt:

Source/WebCore:

FetchResponse.formData() should reject promise with a TypeError if the body is null, to match
the behavior of Chrome and Firefox.

No new tests, rebaselined existing tests.

  • Modules/fetch/FetchBodyOwner.cpp:

(WebCore::FetchBodyOwner::formData):

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r279967 r279969  
     12021-07-15  Chris Dumez  <cdumez@apple.com>
     2
     3        FetchResponse.formData() should reject promise with a TypeError if the body is null
     4        https://bugs.webkit.org/show_bug.cgi?id=228007
     5
     6        Reviewed by Alex Christensen.
     7
     8        Rebaseline WPT tests now that more checks are passing.
     9
     10        * web-platform-tests/fetch/api/request/request-consume-empty.any-expected.txt:
     11        * web-platform-tests/fetch/api/request/request-consume-empty.any.worker-expected.txt:
     12        * web-platform-tests/fetch/api/response/response-consume-empty.any-expected.txt:
     13        * web-platform-tests/fetch/api/response/response-consume-empty.any.worker-expected.txt:
     14
    1152021-07-15  Chris Dumez  <cdumez@apple.com>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.any-expected.txt

    r279344 r279969  
    44PASS Consume request's body as arrayBuffer
    55PASS Consume request's body as json (error case)
    6 FAIL Consume request's body as formData with correct multipart type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
    7 FAIL Consume request's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: undefined
    8 FAIL Consume request's body as formData without correct type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
     6PASS Consume request's body as formData with correct multipart type (error case)
     7FAIL Consume request's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: object "TypeError: Type error"
     8PASS Consume request's body as formData without correct type (error case)
    99PASS Consume empty blob request body as arrayBuffer
    1010PASS Consume empty text request body as arrayBuffer
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/request/request-consume-empty.any.worker-expected.txt

    r279344 r279969  
    44PASS Consume request's body as arrayBuffer
    55PASS Consume request's body as json (error case)
    6 FAIL Consume request's body as formData with correct multipart type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
    7 FAIL Consume request's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: undefined
    8 FAIL Consume request's body as formData without correct type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
     6PASS Consume request's body as formData with correct multipart type (error case)
     7FAIL Consume request's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: object "TypeError: Type error"
     8PASS Consume request's body as formData without correct type (error case)
    99PASS Consume empty blob request body as arrayBuffer
    1010PASS Consume empty text request body as arrayBuffer
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.any-expected.txt

    r279344 r279969  
    44PASS Consume response's body as arrayBuffer
    55PASS Consume response's body as json (error case)
    6 FAIL Consume response's body as formData with correct multipart type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
    7 FAIL Consume response's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: undefined
    8 FAIL Consume response's body as formData without correct type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
     6PASS Consume response's body as formData with correct multipart type (error case)
     7FAIL Consume response's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: object "TypeError: Type error"
     8PASS Consume response's body as formData without correct type (error case)
    99PASS Consume empty blob response body as arrayBuffer
    1010PASS Consume empty text response body as arrayBuffer
  • trunk/LayoutTests/imported/w3c/web-platform-tests/fetch/api/response/response-consume-empty.any.worker-expected.txt

    r279344 r279969  
    44PASS Consume response's body as arrayBuffer
    55PASS Consume response's body as json (error case)
    6 FAIL Consume response's body as formData with correct multipart type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
    7 FAIL Consume response's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: undefined
    8 FAIL Consume response's body as formData without correct type (error case) promise_rejects_js: function "function () { throw e }" threw undefined with type "undefined", not an object
     6PASS Consume response's body as formData with correct multipart type (error case)
     7FAIL Consume response's body as formData with correct urlencoded type promise_test: Unhandled rejection with value: object "TypeError: Type error"
     8PASS Consume response's body as formData without correct type (error case)
    99PASS Consume empty blob response body as arrayBuffer
    1010PASS Consume empty text response body as arrayBuffer
  • trunk/Source/WebCore/ChangeLog

    r279967 r279969  
     12021-07-15  Chris Dumez  <cdumez@apple.com>
     2
     3        FetchResponse.formData() should reject promise with a TypeError if the body is null
     4        https://bugs.webkit.org/show_bug.cgi?id=228007
     5
     6        Reviewed by Alex Christensen.
     7
     8        FetchResponse.formData() should reject promise with a TypeError if the body is null, to match
     9        the behavior of Chrome and Firefox.
     10
     11        No new tests, rebaselined existing tests.
     12
     13        * Modules/fetch/FetchBodyOwner.cpp:
     14        (WebCore::FetchBodyOwner::formData):
     15
    1162021-07-15  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/Source/WebCore/Modules/fetch/FetchBodyOwner.cpp

    r278516 r279969  
    187187
    188188    if (isBodyNullOrOpaque()) {
    189         promise->reject();
     189        promise->reject(TypeError);
    190190        return;
    191191    }
Note: See TracChangeset for help on using the changeset viewer.