Bug 1848757 [wpt PR 41465] - RemoteContextHelper: expose all request headers, a=testonly
commit122220cbf2945eb306a868060743d434b86a9a26
authorBlink WPT Bot <blink-w3c-test-autoroller@chromium.org>
Fri, 8 Sep 2023 18:58:17 +0000 (8 18:58 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Wed, 13 Sep 2023 11:36:53 +0000 (13 11:36 +0000)
tree0adedf7a6d47788f2c559f9dbc48fe527bd84355
parent582925044d6099bc1d6da95de051b71d1da4d188
Bug 1848757 [wpt PR 41465] - RemoteContextHelper: expose all request headers, a=testonly

Automatic update from web-platform-tests
RemoteContextHelper: expose all request headers (#41465)

Previously, we would manually update executor.sub.html to output request
headers into the HTML body. The result would be stored as a global
variable, window.requestHeaders, with absent headers having the string
value "absent".

This improves the situation in several ways:

* Adds a first-class API, getRequestHeaders(), to RemoteContextHelper,
  instead of relying on the implicit knowledge that if you use
  executeScript(), you can retrieve a global window.requestHeaders.

* The returned object is a Headers object, instead of an object literal.
  Absent headers are simply not in the object, instead of being the
  string "absent".

* The returned object has all request headers, not a manually-curated
  list.

* Because all headers are sent across the boundary at once, in the
  single getRequestHeaders() call, we no longer have to call into the
  remote context using executeScript() once per header of interest.

Bug: 1456579
Change-Id: I2c88fde4ed3007e712496f6ab807851e89ac6c6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4778110
Reviewed-by: Fergal Daly <fergal@chromium.org>
Commit-Queue: Domenic Denicola <domenic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1185025}

Co-authored-by: Domenic Denicola <domenic@chromium.org>
--

wpt-commits: dbe925e5b16259430679a3523791c20006947958
wpt-pr: 41465
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/document-state.https.html
testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper-tests/getRequestHeaders.window.js [new file with mode: 0644]
testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor-window.py [new file with mode: 0644]
testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/executor.sub.html [deleted file]
testing/web-platform/tests/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js