Bug 1523562 [wpt PR 14985] - Support document.referrer in SXG, a=testonly
commit29bb1c9cd7af46e6ed16a03152e784d07d14c1a2
authorTsuyoshi Horo <horo@chromium.org>
Thu, 31 Jan 2019 18:59:27 +0000 (31 18:59 +0000)
committerJames Graham <james@hoppipolla.co.uk>
Thu, 7 Feb 2019 21:50:53 +0000 (7 21:50 +0000)
tree16c70a00d69ab7450ce6239cd6a39cba9aaef503
parent830ebe96a7b41bf9d4bbf8dccf0b40bfb7d351ca
Bug 1523562 [wpt PR 14985] - Support document.referrer in SXG, a=testonly

Automatic update from web-platform-tests
Support document.referrer in SXG

Before this CL, CreateRedirectInfo() in signed_exchange_loader.cc doesn't set
redirect_info.new_referrer correctly. So document.referrer was always empty
string after clicking a link of signed exchange.
After this CL, CreateRedirectInfo() returns a RedirectInfo with new_referrer, so
document.referrer will be set correctly.

This CL introduces network::ResourceRequest argument in
NavigationLoaderInterceptor::MaybeCreateLoaderForResponse(),
PrefetchURLLoader, SignedExchangePrefetchHandler and SignedExchangeLoader.
This value will be used to compute a correct RedirectInfo while handling the
synthesized redirect for signed exchange.

This CL uses "ignoreErrors" flag in generate-test-sxgs.sh while creating invalid
signed exchange files. This flags was introduces by this change in webpackage
repository.
https://github.com/WICG/webpackage/commit/d3352199e0a074ef0ce4390232b861560d061425

Bug: 920905
Change-Id: I52a302d22c375b776874c996638b409cdcba8a9c
Reviewed-on: https://chromium-review.googlesource.com/c/1415245
Reviewed-by: Kinuko Yasuda <kinuko@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Kunihiko Sakamoto <ksakamoto@chromium.org>
Commit-Queue: Tsuyoshi Horo <horo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625094}

--

wpt-commits: 5835a01f1f638f866215570119e88f9cac57e8c6
wpt-pr: 14985
19 files changed:
testing/web-platform/tests/signed-exchange/resources/generate-test-sxgs.sh
testing/web-platform/tests/signed-exchange/resources/inner-url.html
testing/web-platform/tests/signed-exchange/resources/sxg-location.html
testing/web-platform/tests/signed-exchange/resources/sxg-util.js
testing/web-platform/tests/signed-exchange/resources/sxg/check-cert-request.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/fallback-to-another-sxg.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/invalid-sxg-referrer-remote-origin.sxg [new file with mode: 0644]
testing/web-platform/tests/signed-exchange/resources/sxg/invalid-sxg-referrer-same-origin.sxg [new file with mode: 0644]
testing/web-platform/tests/signed-exchange/resources/sxg/nested-sxg.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-hsts.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-inner-url-bom.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-invalid-utf8-inner-url.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-invalid-validity-url.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-location.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-noncacheable.sxg
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-referrer-remote-origin.sxg [new file with mode: 0644]
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-referrer-same-origin.sxg [new file with mode: 0644]
testing/web-platform/tests/signed-exchange/resources/sxg/sxg-utf8-inner-url.sxg
testing/web-platform/tests/signed-exchange/sxg-referrer.tentative.https.html [new file with mode: 0644]