Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(19)

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fetch/api/policies/csp-blocked.js

Issue 2778753002: Import //fetch from Web Platform Tests. (Closed)
Patch Set: Baselines. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/external/wpt/fetch/api/policies/csp-blocked.js
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fetch/api/policies/csp-blocked.js b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/policies/csp-blocked.js
new file mode 100644
index 0000000000000000000000000000000000000000..0395304b816240a43d6cd01cd07c877e85a446cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fetch/api/policies/csp-blocked.js
@@ -0,0 +1,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(test, new TypeError(), fetch(cspViolationUrl));
+}, "Fetch is blocked by CSP, got a TypeError");
+
+done();

Powered by Google App Engine
This is Rietveld 408576698