blob: 81db3074d5d55bec0c9dae3afd8c78bcbc6aa751 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/pointer-lock/pointer-lock-test-harness.js"></script>
</head>
<body>
<div>
<div id="target1"></div>
<iframe src="../resources/pointer-lock/iframe-allows-inner-iframe.html" sandbox="allow-scripts" onload="doNextStepWithUserGesture()"></iframe>
</div>
<script>
description("Test nested sandboxed iframes without and then with allow-pointer-lock disallow pointer lock.");
window.jsTestIsAsync = true;
targetDiv1 = document.getElementById("target1");
iframe = document.getElementsByTagName("iframe")[0];
todo = [
function () {
iframe.contentWindow.postMessage(["pass message down", "eval", 'document.body.requestPointerLock()'], "*");
window.onmessage = function (messageEvent) {
message = messageEvent.data;
shouldBeEqualToString("message", "inner-iframe.html onpointerlockerror");
window.onmessage = null;
doNextStep();
}
},
];
// doNextStep() called by iframe onload handler.
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>