Closed Bug 1444166 Opened 6 years ago Closed 6 years ago

[wpt-sync] Sync PR 9931 - Add used body replacement test for Request constructor

Categories

(Core :: DOM: Core & HTML, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: mozilla.org, Unassigned)

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 9931 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/w3c/web-platform-tests/pull/9931
Details from upstream follow.

Harris Hancock wrote:
>  Add used body replacement test for Request constructor
>  
>  This is a WPT companion PR for a Fetch spec change: https://github.com/whatwg/fetch/pull/675. That change allows this currently throwy code snippet to function as expected:
>  
>  ```js
>  let request = new Request(url, { method: "POST", body: "foo" })
>  await request.text()  // disturb the body
>  
>  // currently throws because request is disturbed,
>  // even thought we're providing a new body
>  request = new Request(request, { body: "bar" })
>  ```
>  
>  I tested this on Chrome and Epiphany Tech Preview. As expected, it fails on both because: Chrome does not implement `request.body`, and EPT implements the spec as currently written.
>  
>  /cc @yutakahirano, @annevk
Component: web-platform-tests → DOM
Product: Testing → Core
Ran 1 tests and 9 subtests
OK     : 1
PASS   : 4
FAIL   : 5

New tests that have failures or other problems:
/fetch/api/request/request-disturbed.html
    Check creating a new request with a new body from a disturbed request: FAIL
Pushed by james@hoppipolla.co.uk:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ad7b8e6c3816
[wpt PR 9931] - Add used body replacement test for Request constructor, a=testonly
https://hg.mozilla.org/mozilla-central/rev/ad7b8e6c3816
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.