chromium/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/resources/securitypolicyviolation-test.js

window.jsTestIsAsync = true;

document.addEventListener('securitypolicyviolation', function handleEvent(e) {
    window.e = e;
    for (key in expectations)
        shouldBe('window.e.' + key, JSON.stringify(expectations[key]));
    finishJSTest();
});

window.addEventListener('load', function () {
    debug('Kicking off the tests:');
    run();
});