blob: ea629506a015ada2f31a5336d656d2e2c0f1335a [file] [log] [blame]
<!DOCTYPE html>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="file:///gen/layout_test_data/mojo/public/js/mojo_bindings.js"></script>
<script src="file:///gen/device/vr/public/mojom/vr_service.mojom.js"></script>
<script src="../external/wpt/resources/chromium/webxr-test.js"></script>
<script src="resources/vr-test-utils.js "></script>
<script>
let fakeDisplays = fakeVRDisplays();
vr_test( (t) => {
return navigator.getVRDisplays().then( (displays) => {
let display = displays[0];
let onAnimationFrame3_time = -1;
function onAnimationFrame() {
display.requestAnimationFrame(onAnimationFrame3);
}
function onAnimationFrame2() {
display.requestAnimationFrame(onAnimationFrame4);
}
function onAnimationFrame3(time) {
onAnimationFrame3_time = time;
}
function onAnimationFrame4(time) {
t.step(function() {
assert_equals(time, onAnimationFrame3_time);
});
t.done();
}
display.requestAnimationFrame(onAnimationFrame);
display.requestAnimationFrame(onAnimationFrame2);
}, (err) => {
t.step( () => {
assert_unreached("getVRDisplays rejected");
});
t.done();
});
}, [fakeDisplays["Pixel"]],
"multiple requestAnimationFrame requests call the correct callbacks");
</script>