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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-host_sources-protocols.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-host_sources-protocols.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-host_sources-protocols.html b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-host_sources-protocols.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb4f686043b488df3be86816f929336afa7fc059
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/content-security-policy/embedded-enforcement/subsumption_algorithm-host_sources-protocols.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Embedded Enforcement: Subsumption Algorithm - Scheme parts in host source expressions.</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": "`https` is more restrictive than `http`.",
+ "required_csp": "img-src http://c.com:* https://b.com",
+ "returned_csp": "img-src http://b.com",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "The reverse allows iframe be to be loaded.",
+ "required_csp": "img-src http://c.com:* http://b.com",
+ "returned_csp": "img-src https://b.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "Matching `https` protocols.",
+ "required_csp": "img-src http://c.com:* https://b.com",
+ "returned_csp": "img-src https://b.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "`http:` should subsume all host source expressions with this protocol.",
+ "required_csp": "img-src http:",
+ "returned_csp": "img-src http://c.com:* https://b.com http://c.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "`http:` should subsume all host source expressions with `https:`.",
+ "required_csp": "img-src http:",
+ "returned_csp": "img-src https://c.com:* https://b.com http://c.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "`http:` does not subsume other protocols.",
+ "required_csp": "img-src http:",
+ "returned_csp": "img-src https://c.com:* wss://b.com http://c.com",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "If scheme source is present in returned csp, it must be specified in required csp too.",
+ "required_csp": "img-src https://c.com:* wss://b.com http://c.com",
+ "returned_csp": "img-src http:",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "`http:` subsumes other `http:` source expression.",
+ "required_csp": "img-src http:",
+ "returned_csp": "img-src http: https://c.com:* https://b.com http://c.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "`http:` subsumes other `https:` source expression and expressions with `http:`.",
+ "required_csp": "img-src http:",
+ "returned_csp": "img-src https: https://c.com:* http://b.com",
+ "expected": IframeLoad.EXPECT_LOAD },
+ { "name": "All scheme sources must be subsumed.",
+ "required_csp": "img-src http: wss:",
+ "returned_csp": "img-src https: ws:",
+ "expected": IframeLoad.EXPECT_BLOCK },
+ { "name": "All scheme sources are subsumed by their stronger variants.",
+ "required_csp": "img-src http: wss:",
+ "returned_csp": "img-src https: wss:",
+ "expected": IframeLoad.EXPECT_LOAD },
+ ];
+
+ tests.forEach(test => {
+ async_test(t => {
+ var url = generateUrlWithPolicies(Host.CROSS_ORIGIN, test.returned_csp);
+ 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