summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/trusted-types/support/resolve-spv.js
blob: 89e58b2a8b75e0200d145b028d032caa688f32cd (plain)
1
2
3
4
5
6
7
8
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 });
  });
}