blob: 3e0a3d82b4a45d8f8bfeaf482628dcc0c2d5f192 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>data scheme test</title>
</head>
<body>
<iframe src="data:text/html,&lt;script&gt;window.parent.postMessage(internals.getDocumentAgentId(document), '*');&lt;/script&gt;">
</iframe>
<script>
// This test loads an iframe whose src attribute is a data: URL. It posts
// it's agent ID to this frame, and we report the agent IDs of this frame and
// the child iframe.
//
// Success condition: The agent IDs of this frame and the child frame are
// different (the child frame should receive a unique agent because it's on
// an opaque origin).
function onMessage(evt) {
let iframeAgentId = evt.data;
let message = [
'data scheme test',
internals.getDocumentAgentId(document),
iframeAgentId
];
window.parent.postMessage(message, '*');
}
window.addEventListener('message', onMessage, {'once': true});
</script>
</body>
</html>