Skip to content

Commit 3f61533

Browse files
jdmTG199
authored andcommitted
Run subset of CSP tests by default. (servo#36402)
This will establish a baseline for the changes from servo#36363. Testing: New tests in CI. Fixes: Part of servo#4577 Signed-off-by: Josh Matthews <[email protected]>
1 parent 3b388ed commit 3f61533

File tree

48 files changed

+333
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+333
-0
lines changed

tests/wpt/include.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,14 @@ skip: true
1212
[samesite]
1313
skip: true
1414
[content-security-policy]
15+
[child-src]
16+
skip: false
17+
[connect-src]
18+
skip: false
19+
[default-src]
20+
skip: false
21+
[securitypolicyviolation]
22+
skip: false
1523
[unsafe-eval]
1624
skip: false
1725
[wasm-unsafe-eval]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[child-src-blocked.sub.html]
2+
[Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[child-src-conflicting-frame-src.sub.html]
2+
[Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[child-src-cross-origin-load.sub.html]
2+
[Two of the three iframe are expected to load.]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[child-src-redirect-blocked.sub.html]
2+
[Expecting logs: ["PASS IFrame #1 generated a load event.", "violated-directive=frame-src"\]]
3+
expected: FAIL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[child-src-worker-blocked.sub.html]
2+
expected: ERROR
3+
[Should throw a securitypolicyviolation event]
4+
expected: TIMEOUT
5+
6+
[Should block worker because it does not match any directive including the deprecated 'child-src']
7+
expected: TIMEOUT
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-beacon-allowed.sub.html]
2+
[Expecting logs: ["Pass"\]]
3+
expected: NOTRUN
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-beacon-blocked.sub.html]
2+
[Expecting logs: ["Pass", "violated-directive=connect-src"\]]
3+
expected: NOTRUN
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-beacon-redirect-to-blocked.sub.html]
2+
[Expecting logs: ["violated-directive=connect-src"\]]
3+
expected: NOTRUN
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-eventsource-blocked.sub.html]
2+
[Expecting logs: ["blocked","violated-directive=connect-src"\]]
3+
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-eventsource-redirect-to-blocked.sub.html]
2+
[Expecting logs: ["PASS EventSource() did not follow the disallowed redirect.","TEST COMPLETE", "violated-directive=connect-src"\]]
3+
expected: FAIL
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[connect-src-json-import-allowed.sub.html]
2+
expected: ERROR
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[connect-src-json-import-blocked.sub.html]
2+
expected: ERROR
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-syncxmlhttprequest-blocked.sub.html]
2+
[Expecting logs: ["Pass","violated-directive=connect-src"\]]
3+
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-syncxmlhttprequest-redirect-to-blocked.sub.html]
2+
[Expecting logs: ["PASS Sync XMLHttpRequest.send() did not follow the disallowed redirect.","TEST COMPLETE","violated-directive=connect-src"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-websocket-blocked.sub.html]
2+
[Expecting logs: ["blocked","violated-directive=connect-src"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-xmlhttprequest-blocked.sub.html]
2+
[Expecting logs: ["Pass","violated-directive=connect-src"\]]
3+
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[connect-src-xmlhttprequest-redirect-to-blocked.sub.html]
2+
[Expecting logs: ["PASS XMLHttpRequest.send() did not follow the disallowed redirect.","TEST COMPLETE","violated-directive=connect-src"\]]
3+
expected: FAIL
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[shared-worker-connect-src-allowed.sub.html]
2+
expected: ERROR
3+
[Expecting logs: ["xhr allowed","TEST COMPLETE"\]]
4+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[shared-worker-connect-src-blocked.sub.html]
2+
[Expecting logs: ["xhr blocked","TEST COMPLETE"\]]
3+
expected: NOTRUN
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[worker-connect-src-blocked.sub.html]
2+
[Expecting logs: ["xhr blocked","TEST COMPLETE"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[worker-from-guid.sub.html]
2+
[Expecting logs: ["violated-directive=connect-src","xhr blocked","TEST COMPLETE"\]]
3+
expected: FAIL
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[default-src-inline-blocked.sub.html]
2+
[Expecting logs: ["violated-directive=script-src-elem","violated-directive=script-src-elem"\]]
3+
expected: FAIL
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[default-src-sri_hash.sub.html]
2+
[multiple matching integrity]
3+
expected: FAIL
4+
5+
[partially matching integrity]
6+
expected: FAIL
7+
8+
[External script in a script tag with matching SRI hash should run.]
9+
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[default-src-strict_dynamic_and_unsafe_inline.html]
2+
expected: TIMEOUT
3+
[Should fire a security policy violation for the inline block]
4+
expected: NOTRUN
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[blockeduri-eval.html]
2+
expected: TIMEOUT
3+
[Eval violations have a blockedURI of 'eval']
4+
expected: TIMEOUT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[blockeduri-inline.html]
2+
expected: TIMEOUT
3+
[Inline violations have a blockedURI of 'inline']
4+
expected: TIMEOUT
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[blockeduri-ws-wss-scheme.html]
2+
expected: TIMEOUT
3+
[ws]
4+
expected: FAIL
5+
6+
[wss]
7+
expected: FAIL
8+
9+
[cross-origin]
10+
expected: FAIL
11+
12+
[redirect]
13+
expected: TIMEOUT
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
[idlharness.window.html]
2+
[CSPViolationReportBody interface: existence and properties of interface object]
3+
expected: FAIL
4+
5+
[CSPViolationReportBody interface object length]
6+
expected: FAIL
7+
8+
[CSPViolationReportBody interface object name]
9+
expected: FAIL
10+
11+
[CSPViolationReportBody interface: existence and properties of interface prototype object]
12+
expected: FAIL
13+
14+
[CSPViolationReportBody interface: existence and properties of interface prototype object's "constructor" property]
15+
expected: FAIL
16+
17+
[CSPViolationReportBody interface: existence and properties of interface prototype object's @@unscopables property]
18+
expected: FAIL
19+
20+
[CSPViolationReportBody interface: operation toJSON()]
21+
expected: FAIL
22+
23+
[CSPViolationReportBody interface: attribute documentURL]
24+
expected: FAIL
25+
26+
[CSPViolationReportBody interface: attribute referrer]
27+
expected: FAIL
28+
29+
[CSPViolationReportBody interface: attribute blockedURL]
30+
expected: FAIL
31+
32+
[CSPViolationReportBody interface: attribute effectiveDirective]
33+
expected: FAIL
34+
35+
[CSPViolationReportBody interface: attribute originalPolicy]
36+
expected: FAIL
37+
38+
[CSPViolationReportBody interface: attribute sourceFile]
39+
expected: FAIL
40+
41+
[CSPViolationReportBody interface: attribute sample]
42+
expected: FAIL
43+
44+
[CSPViolationReportBody interface: attribute disposition]
45+
expected: FAIL
46+
47+
[CSPViolationReportBody interface: attribute statusCode]
48+
expected: FAIL
49+
50+
[CSPViolationReportBody interface: attribute lineNumber]
51+
expected: FAIL
52+
53+
[CSPViolationReportBody interface: attribute columnNumber]
54+
expected: FAIL
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[img-src-redirect-upgrade-reporting.https.html]
2+
expected: TIMEOUT
3+
[Image that redirects to http:// URL prohibited by Report-Only must generate a violation report, even with upgrade-insecure-requests]
4+
expected: TIMEOUT
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[img-src-redirect.sub.html]
2+
[The blocked URI in the security policy violation event should be the original URI before redirects.]
3+
expected: FAIL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[inside-dedicated-worker.html]
2+
expected: TIMEOUT
3+
[SecurityPolicyViolation event fired on global.]
4+
expected: FAIL
5+
6+
[SecurityPolicyViolation event fired on global with the correct blockedURI.]
7+
expected: TIMEOUT
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[inside-service-worker.https.html]
2+
expected: TIMEOUT
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[inside-shared-worker.html]
2+
expected: ERROR
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[linenumber.tentative.html]
2+
[linenumber]
3+
expected: FAIL
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[script-sample-no-opt-in.html]
2+
expected: ERROR
3+
[Inline script should not have a sample.]
4+
expected: TIMEOUT
5+
6+
[Inline event handlers should not have a sample.]
7+
expected: TIMEOUT
8+
9+
[JavaScript URLs in iframes should not have a sample.]
10+
expected: TIMEOUT
11+
12+
[eval()-alikes should not have a sample.]
13+
expected: TIMEOUT
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[script-sample.html]
2+
expected: ERROR
3+
[Inline script should have a sample.]
4+
expected: TIMEOUT
5+
6+
[Inline event handlers should have a sample.]
7+
expected: TIMEOUT
8+
9+
[JavaScript URLs in iframes should have a sample.]
10+
expected: TIMEOUT
11+
12+
[eval() should have a sample.]
13+
expected: TIMEOUT
14+
15+
[setInterval() should have a sample.]
16+
expected: TIMEOUT
17+
18+
[setTimeout() should have a sample.]
19+
expected: TIMEOUT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[securitypolicyviolation-block-cross-origin-image-from-script.sub.html]
2+
expected: TIMEOUT
3+
[Non-redirected cross-origin URLs are not stripped.]
4+
expected: TIMEOUT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[securitypolicyviolation-block-cross-origin-image.sub.html]
2+
expected: TIMEOUT
3+
[Non-redirected cross-origin URLs are not stripped.]
4+
expected: TIMEOUT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[securitypolicyviolation-block-image-from-script.sub.html]
2+
expected: TIMEOUT
3+
[Non-redirected cross-origin URLs are not stripped.]
4+
expected: TIMEOUT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[securitypolicyviolation-block-image.sub.html]
2+
expected: TIMEOUT
3+
[Non-redirected same-origin URLs are not stripped.]
4+
expected: TIMEOUT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[source-file-blob-scheme.html]
2+
expected: TIMEOUT
3+
[Violations from data:-URL scripts have a sourceFile of 'blob']
4+
expected: TIMEOUT
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[source-file-data-scheme.html]
2+
expected: TIMEOUT
3+
[Violations from data:-URL scripts have a sourceFile of 'data']
4+
expected: TIMEOUT
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
[source-file.html]
2+
[Basic HTTPS URL]
3+
expected: FAIL
4+
5+
[Basic HTTP URL]
6+
expected: FAIL
7+
8+
[Basic WSS URL]
9+
expected: FAIL
10+
11+
[Basic WS URL]
12+
expected: FAIL
13+
14+
[Fragment]
15+
expected: FAIL
16+
17+
[Query]
18+
expected: FAIL
19+
20+
[Port]
21+
expected: FAIL
22+
23+
[User:password]
24+
expected: FAIL
25+
26+
[User]
27+
expected: FAIL
28+
29+
[Invalid URL]
30+
expected: FAIL
31+
32+
[file:]
33+
expected: FAIL
34+
35+
[Custom protocol]
36+
expected: FAIL
37+
38+
[about:blank]
39+
expected: FAIL
40+
41+
[about:custom]
42+
expected: FAIL
43+
44+
[data:]
45+
expected: FAIL
46+
47+
[blob:]
48+
expected: FAIL
49+
50+
[javascript:]
51+
expected: FAIL
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[style-sample-no-opt-in.html]
2+
expected: TIMEOUT
3+
[Inline style blocks should not have a sample.]
4+
expected: TIMEOUT
5+
6+
[Inline style attributes should not have a sample.]
7+
expected: TIMEOUT
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[style-sample.html]
2+
expected: TIMEOUT
3+
[Inline style blocks should have a sample.]
4+
expected: TIMEOUT
5+
6+
[Inline style attributes should have a sample.]
7+
expected: TIMEOUT
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[targeting.html]
2+
expected: TIMEOUT
3+
[These tests should not fail.]
4+
expected: NOTRUN
5+
6+
[Inline violations target the right element.]
7+
expected: TIMEOUT
8+
9+
[Correct targeting inside shadow tree (inline handler).]
10+
expected: TIMEOUT
11+
12+
[Correct targeting inside shadow tree (style).]
13+
expected: TIMEOUT
14+
15+
[Elements created in this document, but pushed into a same-origin frame trigger on that frame's document, not on this frame's document.]
16+
expected: TIMEOUT
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[upgrade-insecure-requests-reporting.https.html]
2+
expected: TIMEOUT
3+
[Upgraded image is reported]
4+
expected: TIMEOUT
5+
6+
[Upgraded iframe is reported]
7+
expected: TIMEOUT
8+
9+
[Navigated iframe is upgraded and reported]
10+
expected: TIMEOUT

0 commit comments

Comments
 (0)