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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-strict_dynamic.html

Issue 2695813009: Import wpt@503f5b5f78ec4e87d144f78609f363f0ed0ea8db (Closed)
Patch Set: Skip some tests Created 3 years, 10 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/content-security-policy/embedded-enforcement/subsumption_algorithm-strict_dynamic.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-strict_dynamic.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-strict_dynamic.html
new file mode 100644
index 0000000000000000000000000000000000000000..b3e0ea15bdc66e35bcea5ed09f3ad47571c8c45e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-strict_dynamic.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Embedded Enforcement: Subsumption Algorithm - 'strict-dynamic' keyword.</title>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="support/testharness-helper.sub.js"></script>
+</head>
+<body>
+ <script>
+ var tests = [
+ { "name": "'strict-dynamic' is ineffective for `style-src`.",
+ "required_csp": "style-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "style-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' is ineffective for `img-src`.",
+ "required_csp": "img-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "img-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' is ineffective for `frame-src`.",
+ "required_csp": "frame-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "frame-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' is ineffective for `child-src`.",
+ "required_csp": "child-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "child-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' is effective only for `script-src`.",
+ "required_csp": "script-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "script-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "'strict-dynamic' is proper handled for finding effective policy.",
+ "required_csp": "script-src http://example1.com/foo/ 'self'",
+ "returned_csp_1": "script-src 'strict-dynamic' http://example1.com/foo/bar.html",
+ "returned_csp_2": "script-src 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "'strict-dynamic' makes host source expressions ineffective.",
+ "required_csp": "script-src 'strict-dynamic' 'nonce-abc'",
+ "returned_csp_1": "script-src http://example.com 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' makes scheme source expressions ineffective.",
+ "required_csp": "script-src 'strict-dynamic' 'nonce-abc'",
+ "returned_csp_1": "script-src http: 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' makes 'self' ineffective.",
+ "required_csp": "script-src 'strict-dynamic' 'nonce-abc'",
+ "returned_csp_1": "script-src 'self' 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' makes 'unsafe-inline' ineffective.",
+ "required_csp": "script-src 'strict-dynamic' 'nonce-abc'",
+ "returned_csp_1": "script-src 'unsafe-inline' 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "'strict-dynamic' has to be allowed by required csp if it is present in returned csp.",
+ "required_csp": "script-src 'nonce-abc'",
+ "returned_csp_1": "script-src 'strict-dynamic' 'nonce-abc'",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ ];
+ tests.forEach(test => {
+ async_test(t => {
+ var url = generateUrlWithPolicies(Host.CROSS_ORIGIN, test.returned_csp_1);
+ if (test.returned_csp_2)
+ url.searchParams.append("policy2", test.returned_csp_2);
+ assert_iframe_with_csp(t, url, test.required_csp, test.expected, test.name, null);
+ }, test.name);
+ });
+ </script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698