summaryrefslogtreecommitdiffstats
path: root/test/wpt/tests/fetch/api/policies/csp-blocked.js
blob: 28653fff85cf1d4545afd24038b3540d5d49af6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
if (this.document === undefined) {
  importScripts("/resources/testharness.js");
  importScripts("../resources/utils.js");
}

//Content-Security-Policy: connect-src 'none'; cf .headers file
cspViolationUrl = RESOURCES_DIR + "top.txt";

promise_test(function(test) {
  return promise_rejects_js(test, TypeError, fetch(cspViolationUrl));
}, "Fetch is blocked by CSP, got a TypeError");

done();