blob: f7fb828f474e8df448bc0cdb088d29b93cf608da [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/webvr_e2e.css">
</head>
<body>
<canvas id="webgl-canvas"></canvas>
<script src="../../../../../../third_party/WebKit/LayoutTests/resources/testharness.js"></script>
<script src="../resources/webvr_e2e.js"></script>
<script src="../resources/webvr_boilerplate.js"></script>
<script>
var t = async_test("Focus is locked to presentation");
var rafCount = 0;
window.addEventListener("vrdisplaypresentchange",
() => {finishJavaScriptStep();}, false);
window.onfocus = function() {
onAnimationFrameCallback = null;
setTimeout(function() {
document.getElementById('externalframe').contentWindow.focus();
}, 1000);
};
window.onblur = function() {
onAnimationFrameCallback = function() {
if (rafCount = 3) {
finishJavaScriptStep();
t.done();
}
rafCount++;
}
}
</script>
<iframe id="externalframe" width="1" height="1" src="about:blank" />
</body>
</html>