Commit d3ae6478 authored by Daniel Vogelheim's avatar Daniel Vogelheim Committed by Chromium LUCI CQ

[Trusted Types] Use sample script value that is actually a script.

Fix-It week: The test passes, but will then report an error in the
test harness, because the string chosen for the example test is not
actually a valid script. If we simply return "0" - which is valid JS -
the bug disappears. (The test doesn't care about the script anyhow, only
about whether it's accepted as input ot not.)

Change-Id: Ie36c27965494f71b796176d3818aefd41b3067ab
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2574953Reviewed-by: default avatarYifan Luo <lyf@chromium.org>
Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834635}
parent dafe8eec
......@@ -54,13 +54,12 @@
});
}, "`window.setInterval(null)` throws.");
let policy = window.trustedTypes.createPolicy("default", { createScript: x => "0" });
// After default policy creation string assignment implicitly calls createScript.
test(t => {
let policy = window.trustedTypes.createPolicy("default", { createScript: createScriptJS }, true);
setTimeout(INPUTS.SCRIPT);
setInterval(INPUTS.SCRIPT);
}, "`setTimeout(string)`, `setInterval(string)` via default policy (successful Script transformation).");
// After default policy creation null assignment implicitly calls createScript.
test(t => {
setTimeout(null);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment