Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c

This commit is contained in:
Josh Matthews 2018-01-31 09:13:41 -05:00
parent c88dc51d03
commit 0e1caebaf4
791 changed files with 23381 additions and 5501 deletions

View file

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that reports using the report-api service are not sent when there's not validation</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var t1 = async_test("Test that image loads");
window.addEventListener("securitypolicyviolation",
t1.unreached_func("Should not have triggered a violation event"));
</script>
<img src='/content-security-policy/support/pass.png'
onload='t1.done();'
onerror='t1.unreached_func("The image should have loaded");'>
<script async defer src='../support/checkReport.sub.js?reportExists=false'></script>
</body>
</html>

View file

@ -0,0 +1,7 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: reporting-api-doesnt-send-reports-without-violation={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id}}", "group": "csp-group", "max-age": 10886400 }
Content-Security-Policy: script-src 'self' 'unsafe-inline'; img-src 'self'; report-to csp-group

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that report-only policies still work with report-to</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var t1 = async_test("Test that image does not load");
async_test(function(t2) {
window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png");
assert_equals(e.violatedDirective, "img-src");
t2.done();
}));
}, "Event is fired");
</script>
<img src='/content-security-policy/support/fail.png'
onload='t1.done();'
onerror='t1.unreached_func("The image should have loaded");'>
<script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27'></script>
</body>
</html>

View file

@ -0,0 +1,7 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: reporting-api-report-only-sends-reports-on-violation={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id}}", "group": "csp-group", "max-age": 10886400 }
Content-Security-Policy-Report-Only: script-src 'self' 'unsafe-inline'; img-src 'none'; report-to csp-group

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that report-to overrides report-uri. This tests report-uri before report-to in the policy</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var t1 = async_test("Test that image does not load");
async_test(function(t2) {
window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png");
assert_equals(e.violatedDirective, "img-src");
t2.done();
}));
}, "Event is fired");
</script>
<img src='/content-security-policy/support/fail.png'
onload='t1.unreached_func("The image should not have loaded");'
onerror='t1.done();'>
<!-- report-to overrides the report-uri so the report goes to a different endpoint and we should not have any reports sent to this endpoint -->
<script async defer src='../support/checkReport.sub.js?reportExists=false></script>
</body>
</html>

View file

@ -0,0 +1,7 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: reporting-api-report-to-overrides-report-uri-1={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Content-Security-Policy: script-src 'self' 'unsafe-inline'; img-src 'none'; report-uri "/content-security-policy/support/report.py?op=put&reportID={{$id}}"; report-to csp-group
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id:uuid()}}", "group": "csp-group", "max-age": 10886400 }

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that report-to overrides report-uri. This tests report-uri after report-to in the policy</title> <meta name=timeout content=long>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var t1 = async_test("Test that image does not load");
async_test(function(t2) {
window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png");
assert_equals(e.violatedDirective, "img-src");
t2.done();
}));
}, "Event is fired");
</script>
<img src='/content-security-policy/support/fail.png'
onload='t1.unreached_func("The image should not have loaded");'
onerror='t1.done();'>
<!-- report-to overrides the report-uri so the report goes to a different endpoint and we should not have any reports sent to this endpoint -->
<script async defer src='../support/checkReport.sub.js?reportExists=false></script>
</body>
</html>

View file

@ -0,0 +1,7 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: reporting-api-report-to-overrides-report-uri-2={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Content-Security-Policy: script-src 'self' 'unsafe-inline'; img-src 'none'; report-to csp-group; report-uri "/content-security-policy/support/report.py?op=put&reportID={{$id}}"
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id:uuid()}}", "group": "csp-group", "max-age": 10886400 }

View file

@ -0,0 +1,25 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that reports using the report-api service are sent when there's a violation</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
var t1 = async_test("Test that image does not load");
async_test(function(t2) {
window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.png");
assert_equals(e.violatedDirective, "img-src");
t2.done();
}));
}, "Event is fired");
</script>
<img src='/content-security-policy/support/fail.png'
onload='t1.unreached_func("The image should not have loaded");'
onerror='t1.done();'>
<script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27'></script>
</body>
</html>

View file

@ -0,0 +1,7 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Cache-Control: post-check=0, pre-check=0, false
Pragma: no-cache
Set-Cookie: reporting-api-sends-reports-on-violation={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id}}", "group": "csp-group", "max-age": 10886400 }
Content-Security-Policy: script-src 'self' 'unsafe-inline'; img-src 'none'; report-to csp-group

View file

@ -0,0 +1,22 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test that reports using the report-api service are sent when there's a violation</title>
<script src='/resources/testharness.js'></script>
<script src='/resources/testharnessreport.js'></script>
</head>
<body>
<script>
async_test(function(t2) {
window.addEventListener("securitypolicyviolation", t2.step_func(function(e) {
assert_equals(e.blockedURI, "{{location[scheme]}}://{{location[host]}}/content-security-policy/support/fail.html");
assert_equals(e.violatedDirective, "frame-src");
t2.done();
}));
}, "Event is fired");
</script>
<iframe src="../support/fail.html"></iframe>
<script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=frame-src%20%27none%27'></script>
</body>
</html>

View file

@ -0,0 +1,6 @@
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: reporting-api-works-on-frame-src={{$id:uuid()}}; Path=/content-security-policy/reporting-api
Report-To: { "url": "https://{{host}}:{{ports[https][0]}}/content-security-policy/support/report.py?op=put&reportID={{$id}}", "group": "csp-group", "max-age": 10886400 }
Content-Security-Policy: script-src 'self' 'unsafe-inline'; frame-src 'none'; report-to csp-group