Automatic update from web-platform-tests [Sanitizer] Fix Secure Context restriction. Previously, the Sanitizer was (correctly) secure-context restricted, but the Element.setHTML method that uses it wasn't. This fixes this, plus adds WPT tests. Bug: 1326827 Change-Id: I4e3100896527b0f093fa55923168b4e360eabfc4 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3721649 Reviewed-by: Yifan Luo <lyf@chromium.org> Commit-Queue: Daniel Vogelheim <vogelheim@chromium.org> Cr-Commit-Position: refs/heads/main@{#1017602} -- wpt-commits: e95912d4544d3a77ccb02cddddfa84ab18dba60f wpt-pr: 34576
18 lines
502 B
HTML
18 lines
502 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
</head>
|
|
<body>
|
|
<script>
|
|
// Currently, the Sanitizer requires a secure context.
|
|
test(t => {
|
|
assert_true(globalThis.isSecureContext);
|
|
assert_equals("Sanitizer" in globalThis, globalThis.isSecureContext);
|
|
assert_equals("setHTML" in document.body, globalThis.isSecureContext);
|
|
}, "SanitizerAPI in a secure context.");
|
|
</script>
|
|
</body>
|
|
</html>
|