This test is here: https://github.com/w3c/web-platform-tests/blob/master/service-workers/service-worker/fetch-event.https.html
Several problems related to this test are found at my quick investigation...
On the test of referrerPolicy (l.206):
- When referrer attribute is set to undefined, fetch API seems to handle it as "undefined". (l.221)
- The test uses fetch() to HTTP_ORIGIN though the origin of main page is on https. (l.82)
- Although he test set referrer as "fake-referrer" (l.227) and fires fetch() from an iframe under resources/, expected referrer is set to "get_host_info()['HTTPS_ORIGIN'] + base_path() + 'fake-referrer'" (l.226). I took also a look at the spec[1], but I still think this might be wrong.
[1]: https://fetch.spec.whatwg.org/#concept-request-referrer
Cc: shimazu@chromium.org yhirano@chromium.org jakearchibald@chromium.org Owner: yiyix@chromium.org Status: Started (was: Assigned)
Regarding: When referrer attribute is set to undefined, fetch API seems to handle it as "undefined".
This can be reproduced by checking:
new Request('', { referrer: undefined });
Chrome creates a Request whose .referrer ends with "/undefined".
Firefox creates a Request whose .referrer is "about:client"
Chrome is certainly wrong, but I'm not sure what the Fetch spec says:
"Let parsedReferrer be the result of parsing referrer with baseURL." => Not clear to me what the parse algorithm says when |referrer| is undefined.
Adding jakearchibald@ and yhirano@ if they have insight.
Just talked to domenic@, when something is undefined, it means it is not "present" in spec language. So we don't get into the "If init’s referrer member is present, run these substeps" part. So Firefox behavior is indeed what the spec says.
Blockedon:453190 Labels: -M-59 Owner: ---- Status: Available (was: Started)
Blocked on Request.cache among others:
FAIL Service Worker responds to fetch event with the correct cache types assert_unreached: unexpected rejection: assert_equals: Service Worker should respond to fetch with the correct type expected "no-store" but got "default" Reached unreachable code
FAIL Service Worker should intercept EventSource assert_unreached: unexpected rejection: assert_equals: EventSource should bypass the http cache. expected "no-store" but got "default" Reached unreachable code
FAIL Service Worker responds to fetch event with the correct integrity_metadata assert_unreached: unexpected rejection: assert_equals: integrity expected "gs0nqru8KbsrIt5YToQqS9fYao4GQJXtcId610g7cCU=" but got "" Reached unreachable code
Comment 1 by shimazu@chromium.org
, Jun 29 2016