csp-blocked.js (393B)
1 if (this.document === undefined) { 2 importScripts("/resources/testharness.js"); 3 importScripts("../resources/utils.js"); 4 } 5 6 //Content-Security-Policy: connect-src 'none'; cf .headers file 7 cspViolationUrl = RESOURCES_DIR + "top.txt"; 8 9 promise_test(function(test) { 10 return promise_rejects_js(test, TypeError, fetch(cspViolationUrl)); 11 }, "Fetch is blocked by CSP, got a TypeError"); 12 13 done();