summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webxr/render_state_vertical_fov_immersive.https.html
blob: c09cd7c174d3b338a319141f7902023d36fe87fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="resources/webxr_util.js"></script>
<script src="resources/webxr_test_constants.js"></script>

<script>
let testName = "inlineVerticalFieldOfView is set appropriately on immersively sessions";

let fakeDeviceInitParams = TRACKED_IMMERSIVE_DEVICE;

let testFunction = function(session, fakeDeviceController, t) {
  return new Promise((resolve, reject) => {
      // inlineVerticalFieldOfView should be null for immersive sessions;
      t.step(() => {
        assert_equals(session.renderState.inlineVerticalFieldOfView, null);
      });

      // Trying to set it should throw an exception
      try {
        session.updateRenderState({
          inlineVerticalFieldOfView: 1.0
        });

        t.step(() => {
          assert_unreached("Should not be able to set inlineVerticalFieldOfView on immersive sessions");
        });
      } catch(err) {
        t.step(() => {
          assert_equals(err.name, "InvalidStateError");
        });
      }

      resolve();
  });
};

xr_session_promise_test(
  testName, testFunction, fakeDeviceInitParams, 'immersive-vr');

</script>