mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests [Client Hints] Add WPT for wildcards in iframe subresource request We should verify this works two levels deep cross-origin. Right now there is no test quite like this one. Change-Id: If4b4b3f23405d687de504e65d5ada967adbdb190 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4547447 Reviewed-by: Victor Tan <[email protected]> Commit-Queue: Victor Tan <[email protected]> Auto-Submit: Ari Chivukula <[email protected]> Cr-Commit-Position: refs/heads/main@{#1146165} -- wpt-commits: fa1adf0e19f929c4f9ea93b9d19a3f3d18a69352 wpt-pr: 40081
26 lines
925 B
HTML
26 lines
925 B
HTML
<!DOCTYPE html>
|
|
<body>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script>
|
|
// Here's the set-up for this test:
|
|
// Step 1 (top-frame) Embeds a cross-origin iframe.
|
|
// Step 2 (sub-frame) Make a cross-origin POST request.
|
|
// Step 3 (sub-frame) Checks if platform version header is present and alerts top frame.
|
|
// Step 4 (top-frame) Asserts header was present and returns.
|
|
async_test(t => {
|
|
// Step 4
|
|
window.addEventListener("message", t.step_func(e => {
|
|
assert_equals(e.data, "HadPlatformVersion");
|
|
t.done();
|
|
}));
|
|
|
|
// Step 1
|
|
let iframe = document.createElement("iframe");
|
|
iframe.src = "https://{{domains[www1]}}:{{ports[https][0]}}/client-hints/resources/accept-ch.wildcard.iframe.https.sub.html";
|
|
document.body.appendChild(iframe);
|
|
}, "Accept-CH with wildcard policy and iframe subresource");
|
|
</script>
|
|
</body>
|
|
</html>
|