Update web-platform-tests to revision c2b30ef30749b6a8f2cc832761dfe011e63d5e94

This commit is contained in:
WPT Sync Bot 2018-10-05 21:34:34 -04:00
parent 987e376ca7
commit eda9b9b73a
142 changed files with 3513 additions and 851 deletions

View file

@ -10,19 +10,25 @@
</head>
<body>
<script>
var test = async_test("Image should not load");
fetch(
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie1&path=" + encodeURIComponent("{{domains[www1]}}:{{ports[http][0]}}/"),
{mode: 'no-cors', credentials: 'include'})
.then(() => {
// This image will generate a CSP violation report.
const img = new Image();
img.onerror = test.step_func_done();
img.onload = test.unreached_func("Should not have loaded the image");
promise_test(function(test) {
const path = encodeURIComponent("{{domains[www1]}}:{{ports[http][0]}}/");
return fetch(
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie1&path=" + path,
{mode: 'no-cors', credentials: 'include'})
.then(() => {
test.add_cleanup(() => {
return fetch("/cookies/resources/set.py?cspViolationReportCookie1=; path=" + path + "; expires=Thu, 01 Jan 1970 00:00:01 GMT");
});
img.src = "../support/fail.png";
document.body.appendChild(img);
});
// This image will generate a CSP violation report.
const img = new Image();
img.onerror = test.step_func_done();
img.onload = test.unreached_func("Should not have loaded the image");
img.src = "../support/fail.png";
document.body.appendChild(img);
});
}, "Image should not load");
</script>
<script async defer src='../support/checkReport.sub.js?reportField=violated-directive&reportValue=img-src%20%27none%27&noCookies=true'></script>

View file

@ -15,6 +15,10 @@
"/cookies/resources/set-cookie.py?name=cspViolationReportCookie2&path=" + encodeURIComponent("/"),
{mode: 'no-cors', credentials: 'include'})
.then(() => {
test.add_cleanup(() => {
document.cookie = "cspViolationReportCookie2=; path=/; expires=Thu, 01 Jan 1970 00:00:01 GMT";
});
// This image will generate a CSP violation report.
const img = new Image();
img.onerror = test.step_func_done();