Skip to content

Commit

Permalink
Import wpt@92f3985e2d4e3c11b813910771e232003b5c85f6
Browse files Browse the repository at this point in the history
Using wpt-import in Chromium 1e2105c.

Note to sheriffs: This CL imports external tests and adds
expectations for those tests; if this CL is large and causes
a few new failures, please fix the failures by adding new
lines to TestExpectations rather than reverting. See:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md

Directory owners for changes in this CL:
igrigorik@chromium.org, yoavweiss@chromium.org:
  external/wpt/preload

NOAUTOREVERT=true
R=rubber-stamper@appspot.gserviceaccount.com

No-Export: true
Cq-Include-Trybots: luci.chromium.try:linux-wpt-identity-fyi-rel,linux-wpt-input-fyi-rel,linux-blink-rel
Change-Id: I043bb75b83a57c016e7dd8c91b272f0c2ffa42df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3538603
Auto-Submit: WPT Autoroller <wpt-autoroller@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#983128}
  • Loading branch information
Chromium WPT Sync authored and Chromium LUCI CQ committed Mar 20, 2022
1 parent 54e4bd8 commit 3d71802
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion third_party/blink/web_tests/external/Version
@@ -1 +1 @@
Version: cba216de2a71653c0b08c0e91577fb4e2426fa0e
Version: 92f3985e2d4e3c11b813910771e232003b5c85f6
7 changes: 7 additions & 0 deletions third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
Expand Up @@ -489058,6 +489058,13 @@
{}
]
],
"preload-dynamic-csp.html": [
"7a696cb7ed8c42e7b3c749d5cebdd17c0f571e76",
[
null,
{}
]
],
"preload-font-crossorigin.html": [
"492dc393cc847d09847162ea282cd478d3b8811a",
[
Expand Down
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<title>Makes sure that preload requests respect CSP directives that are added after the preload</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/preload/resources/preload_helper.js"></script>
<link id="preload" rel=preload href="resources/square.png" as=image>
<body>
<script>
setup({single_test: true});

const preload = document.querySelector("#preload");
preload.addEventListener("load", async () => {
const meta = document.createElement("meta");
meta.httpEquiv = "Content-Security-Policy";
meta.content = "img-src 'none'";
document.head.appendChild(meta);
const img = document.createElement("img");
img.src = preload.href;
document.body.appendChild(img);
const load = new Promise(resolve => img.addEventListener("load", () => resolve('load')));
const error = new Promise(resolve => img.addEventListener("error", () => resolve('error')));
const result = await Promise.any([load, error]);
assert_equals(result, "error");
done();
});
</script>

0 comments on commit 3d71802

Please sign in to comment.