diff options
Diffstat (limited to 'testing/web-platform/tests/trusted-types/support')
-rw-r--r-- | testing/web-platform/tests/trusted-types/support/resolve-spv.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/testing/web-platform/tests/trusted-types/support/resolve-spv.js b/testing/web-platform/tests/trusted-types/support/resolve-spv.js new file mode 100644 index 0000000000..89e58b2a8b --- /dev/null +++ b/testing/web-platform/tests/trusted-types/support/resolve-spv.js @@ -0,0 +1,9 @@ +// Returns a promise that resolves with a Security Policy Violation (spv) + // even when it is received. +function promise_spv() { + return new Promise((resolve, reject) => { + window.addEventListener("securitypolicyviolation", e => { + resolve(e); + }, { once: true }); + }); +} |