Skip to content

Commit

Permalink
Bug 1777453 [wpt PR 34659] - Make about:srcdoc to inherit PolicyConta…
Browse files Browse the repository at this point in the history
…iner from history., a=testonly

Automatic update from web-platform-tests
Make about:srcdoc to inherit PolicyContainer from history.

This correspond to HTML PR:
whatwg/html#8057
We should wait for the HTML PR to be merged before reflecting this into
the test.

This makes the test to pass on Chrome and Firefox, who both restore
PolicyContainer from history.

Bug: 1329190
Change-Id: Ib9dfd5a592295cbabb5dffbb690e430c350161ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3735763
Commit-Queue: Arthur Sonzogni <[email protected]>
Reviewed-by: Antonio Sartori <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1024257}

--

wpt-commits: 5152f7028dd6db37dfaa12f52fa467833cabd8e5
wpt-pr: 34659
  • Loading branch information
ArthurSonzogni authored and moz-wptsync-bot committed Jul 21, 2022
1 parent 181d45b commit 1e33cf8
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ <h1>This is a dummy page that should not store the inherited policy
const img = iframe.contentDocument.createElement('img');

const promise = new Promise((resolve, reject) => {
iframe.contentDocument.onsecuritypolicyviolation = resolve;
img.onload = resolve;
// First the security policy violation should be reported, which will finish
// this test. If for some reason the error event is fired without the
// violation being reported, something else went wrong—fail the test.
img.error = e => {
reject(new Error("The srcdoc iframe's img failed to load but not due to " +
"a CSP violation"));
};
img.onload = e => {
reject(new Error("The srcdoc iframe's img loaded correctly, bypassing " +
"the parent's update CSP"));
iframe.contentDocument.onsecuritypolicyviolation = e => {
reject(new Error("The srcdoc iframe's img has been blocked by the " +
"new CSP. It means it was different and wasn't restored from history"));
};
});
// The srcdoc iframe tries to load an image, and should generate a security
Expand Down

0 comments on commit 1e33cf8

Please sign in to comment.