blob: df0247dc4594e14bb99aca085a077964d8085964 [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="../vr/resources/fake-vr-displays.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/device/vr/vr_service.mojom.js"></script>
<script src="../vr/resources/mock-vr-service.js"></script>
<canvas id="webgl-canvas"></canvas>
<script src="../vr/resources/presentation-setup.js"></script>
<script>
let fakeDisplays = fakeVRDisplays();
xr_session_test( (t, session) => {
// Session must have a baseLayer or frame requests will be ignored.
session.baseLayer = new XRWebGLLayer(session, gl);
function onFrame(time, xrFrame) {
t.step( () => {
assert_true(xrFrame instanceof XRPresentationFrame);
});
t.done();
}
session.requestAnimationFrame(onFrame);
}, fakeDisplays["Pixel"], { exclusive: true },
"XRSession requestAnimationFrame properly calls the provided callback");
</script>