blob: 94fd3a85f925e867b2802f4ee09bcc277e1707b5 [file] [log] [blame]
<!doctype html>
<!--
Tests that when a screen taps causes a frame that isn't presenting to gain
focus, that the presenting frame still receives input.
-->
<html>
<head>
<link rel="stylesheet" type="text/css" href="../resources/webxr_e2e.css">
</head>
<body>
<canvas id="webgl-canvas"></canvas>
<script src="../../../../../../third_party/blink/web_tests/resources/testharness.js"></script>
<script src="../resources/webxr_e2e.js"></script>
<script src="../resources/webvr_boilerplate.js"></script>
<script>
var t = async_test("Focus is locked to presentation");
var rafCount = 0;
function stepSetupFocusLoss() {
onPresentingAnimationFrameCallback = null;
setTimeout(function() {
document.getElementById('externalframe').contentWindow.focus();
}, 1000);
}
window.onblur = function() {
onPresentingAnimationFrameCallback = function() {
if (rafCount == 3) {
t.done();
}
rafCount++;
}
}
</script>
<iframe id="externalframe" width="1" height="1" src="about:blank" />
</body>
</html>