blob: dd747d48855ab0839a8f2d30d0111a98c2af6b9b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>Cross-origin test</title>
</head>
<body>
<iframe src="https://127.0.0.1:8443/security/resources/agent-equality-report-to-parent.html">
</iframe>
<script>
// This file should be loaded as an iframe hosted on 127.0.0.1:8000 on HTTP.
// This test creates the following frame tree:
//
// A: http://127.0.0.1:8000 (this file)
// |
// +-- B: https://127.0.0.1:8443
//
// This page posts a message to the parent window, containing two strings
// which correspond to the agent IDs of A and B, respectively.
//
// Success condition: A's agent is not the same as B's.
function onMessage(evt) {
let agentIdB = evt.data;
let message = [
'different-schemes test',
internals.getAgentId(window),
agentIdB
];
window.parent.postMessage(message, '*');
}
window.addEventListener('message', onMessage, {'once': true});
</script>
</body>
</html>