blob: d894c2bed23ac2d29d2fb08fd7a2fa3991a3f8c8 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="resources/multiple-iframe-test.js"></script>
<script>
if (window.internals) {
internals.registerDefaultPortForProtocol(8000, "http");
internals.registerDefaultPortForProtocol(8443, "https");
}
var tests = [
// Tests that HTTP URL with explicit default port number matches HTTP source expression with implicit and explicit default port number.
["yes", "script-src http://127.0.0.1", "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js"],
["yes", "script-src http://127.0.0.1:8000", "http://127.0.0.1:8000/security/contentSecurityPolicy/resources/script.js"],
// Tests that HTTPS URL with explicit default port number matches HTTP source expression with implicit and explicit default port number.
["yes", "script-src http://127.0.0.1", "https://127.0.0.1:8443/security/contentSecurityPolicy/resources/script.js"],
["yes", "script-src http://127.0.0.1:8000", "https://127.0.0.1:8443/security/contentSecurityPolicy/resources/script.js"],
// Tests that HTTPS URL with explicit default port number matches 'self'.
["yes", "script-src 'self'", "https://127.0.0.1:8443/security/contentSecurityPolicy/resources/script.js"],
];
</script>
</head>
<body onload="test()">
<p>Tests script-src source expression matching with implicit and explicit default port numbers.</p>
</body>
</html>