mirror of
https://github.com/servo/servo.git
synced 2025-08-16 10:55:34 +01:00
Update web-platform-tests to revision 8f8ff0e2a61f2a24996404921fe853cb1fd9b432
This commit is contained in:
parent
e98cd07910
commit
141a52794b
58 changed files with 1615 additions and 276 deletions
|
@ -7,23 +7,31 @@
|
|||
<title>connect-src-eventsource-allowed</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../support/logTest.sub.js?logs=["Pass"]'></script>
|
||||
<script src='../support/logTest.sub.js?logs=["allowed"]'></script>
|
||||
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener('securitypolicyviolation', function(e) {
|
||||
log("FAIL");
|
||||
log("allowed");
|
||||
});
|
||||
|
||||
try {
|
||||
var es = new EventSource("http://{{host}}:{{ports[http][0]}}/content-security-policy/connect-src/resources/simple-event-stream");
|
||||
log("Pass");
|
||||
} catch (e) {
|
||||
log("Fail");
|
||||
}
|
||||
|
||||
try {
|
||||
var es = new EventSource("http://{{domains[www1]}}:{{ports[http][0]}}/content-security-policy/connect-src/resources/simple-event-stream");
|
||||
// Firefox and Chrome don't throw an exception and takes some time to close async
|
||||
if (es.readyState == EventSource.CONNECTING) {
|
||||
setTimeout( function() {
|
||||
es.readyState != EventSource.CLOSED ? log("allowed") : log("blocked");
|
||||
}, 1000);
|
||||
} else if (es.readyState == EventSource.CLOSED) {
|
||||
log("blocked");
|
||||
} else {
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("blocked");
|
||||
}
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<title>connect-src-eventsource-blocked</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../support/logTest.sub.js?logs=["Pass","violated-directive=connect-src"]'></script>
|
||||
<script src='../support/logTest.sub.js?logs=["blocked","violated-directive=connect-src"]'></script>
|
||||
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
|
||||
</head>
|
||||
|
||||
|
@ -16,21 +16,21 @@
|
|||
window.addEventListener('securitypolicyviolation', function(e) {
|
||||
log("violated-directive=" + e.violatedDirective);
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
var es = new EventSource("http://www1.{{host}}:{{ports[http][0]}}/content-security-policy/connect-src/resources/simple-event-stream");
|
||||
// Firefox doesn't throw an exception and takes some time to close async
|
||||
var es = new EventSource("http://{{domains[www1]}}:{{ports[http][0]}}/content-security-policy/connect-src/resources/simple-event-stream");
|
||||
// Firefox and Chrome don't throw an exception and takes some time to close async
|
||||
if (es.readyState == EventSource.CONNECTING) {
|
||||
setTimeout( function() {
|
||||
es.readyState != EventSource.CLOSED ? log("Fail") : log("Pass");
|
||||
}, 2);
|
||||
es.readyState != EventSource.CLOSED ? log("allowed") : log("blocked");
|
||||
}, 1000);
|
||||
} else if (es.readyState == EventSource.CLOSED) {
|
||||
log("Pass");
|
||||
log("blocked");
|
||||
} else {
|
||||
log("Fail");
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("Pass");
|
||||
log("blocked");
|
||||
}
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
|
|
|
@ -2,26 +2,31 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src 'self' ws://127.0.0.1:8880; script-src 'self' 'unsafe-inline';">
|
||||
<title>connect-src-websocket-allowed</title>
|
||||
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncraciws.-->
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src 'self' ws://{{domains[www1]}}:{{ports[http][0]}}/echo; script-src 'self' 'unsafe-inline';">
|
||||
<title>connect-src-websocket-blocked</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../support/logTest.sub.js?logs=["Pass"]'></script>
|
||||
<script src='../support/logTest.sub.js?logs=["allowed"]'></script>
|
||||
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener('securitypolicyviolation', function(e) {
|
||||
log("Fail");
|
||||
log("violated-directive=" + e.violatedDirective);
|
||||
});
|
||||
|
||||
|
||||
try {
|
||||
var ws = new WebSocket("ws://127.0.0.1:8880/echo");
|
||||
log("Pass");
|
||||
var ws = new WebSocket("ws://{{domains[www1]}}:{{ports[http][0]}}/echo");
|
||||
|
||||
if (ws.readyState == WebSocket.CLOSING || ws.readyState == WebSocket.CLOSED) {
|
||||
log("blocked");
|
||||
} else {
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("Fail");
|
||||
log("blocked");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncracies.-->
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src 'self' ws://127.0.0.1:8880; script-src 'self' 'unsafe-inline';">
|
||||
<!-- Programmatically converted from a WebKit Reftest, please forgive resulting idiosyncraciws.-->
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src 'self'; script-src 'self' 'unsafe-inline';">
|
||||
<title>connect-src-websocket-blocked</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../support/logTest.sub.js?logs=["Pass","violated-directive=connect-src"]'></script>
|
||||
<script src='../support/logTest.sub.js?logs=["blocked","violated-directive=connect-src"]'></script>
|
||||
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
|
||||
</head>
|
||||
|
||||
|
@ -18,10 +18,15 @@
|
|||
});
|
||||
|
||||
try {
|
||||
var ws = new WebSocket("ws://localhost:8880/echo");
|
||||
log("Fail");
|
||||
var ws = new WebSocket("ws://{{domains[www1]}}:{{ports[http][0]}}/echo");
|
||||
|
||||
if (ws.readyState == WebSocket.CLOSING || ws.readyState == WebSocket.CLOSED) {
|
||||
log("blocked");
|
||||
} else {
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("Pass");
|
||||
log("blocked");
|
||||
}
|
||||
|
||||
</script>
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Security-Policy" content="connect-src 'self'; script-src 'self' 'unsafe-inline';">
|
||||
<title>connect-src-websocket-blocked</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src='../support/logTest.sub.js?logs=["allowed", "allowed"]'></script>
|
||||
<script src="../support/alertAssert.sub.js?alerts=[]"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener('securitypolicyviolation', function(e) {
|
||||
log("violated-directive=" + e.violatedDirective);
|
||||
});
|
||||
|
||||
try {
|
||||
var ws = new WebSocket("ws://{{host}}:{{location[port]}}/echo");
|
||||
|
||||
if (ws.readyState == WebSocket.CLOSING || ws.readyState == WebSocket.CLOSED) {
|
||||
log("blocked");
|
||||
} else {
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("blocked");
|
||||
}
|
||||
|
||||
try {
|
||||
var wss = new WebSocket("wss://{{host}}:{{location[port]}}/echo");
|
||||
|
||||
if (wss.readyState == WebSocket.CLOSING || wss.readyState == WebSocket.CLOSED) {
|
||||
log("blocked");
|
||||
} else {
|
||||
log("allowed");
|
||||
}
|
||||
} catch (e) {
|
||||
log("blocked");
|
||||
}
|
||||
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue