diff options
Diffstat (limited to 'tests/wpt')
-rw-r--r-- | tests/wpt/mozilla/tests/webxr/obtain_frame.html | 8 | ||||
-rw-r--r-- | tests/wpt/mozilla/tests/webxr/resources/webxr-util.js | 7 |
2 files changed, 9 insertions, 6 deletions
diff --git a/tests/wpt/mozilla/tests/webxr/obtain_frame.html b/tests/wpt/mozilla/tests/webxr/obtain_frame.html index 99d8fd1ef15..d4ebadeda76 100644 --- a/tests/wpt/mozilla/tests/webxr/obtain_frame.html +++ b/tests/wpt/mozilla/tests/webxr/obtain_frame.html @@ -11,9 +11,11 @@ let canvas = document.getElementById("canvas"); let gl = canvas.getContext('webgl'); promise_test(async function() { - let mock = await navigator.xr.test.simulateDeviceConnection({supportsImmersive: true}); - mock.setViewerOrigin({position: [0.5, 0.1, 0.1, 1], orientation: [1, 0, 0, 1] }); - mock.setViews(TEST_VIEWS); + let mock = await navigator.xr.test.simulateDeviceConnection({ + supportsImmersive: true, + views: TEST_VIEWS, + viewerOrigin: {position: [0.5, 0.1, 0.1, 1], orientation: [1, 0, 0, 1] } + }); let session = await navigator.xr.requestSession({mode: "immersive-vr"}); await session.updateRenderState({"baseLayer": new XRWebGLLayer(session, gl, {})}); let resolve; diff --git a/tests/wpt/mozilla/tests/webxr/resources/webxr-util.js b/tests/wpt/mozilla/tests/webxr/resources/webxr-util.js index b644ba72ac8..554c1c183d3 100644 --- a/tests/wpt/mozilla/tests/webxr/resources/webxr-util.js +++ b/tests/wpt/mozilla/tests/webxr/resources/webxr-util.js @@ -3,7 +3,8 @@ const VALID_PROJECTION_MATRIX = [1, 0, 0, 0, 0, 1, 0, 0, 3, 2, -1, -1, 0, 0, -0.2, 0]; const LEFT_OFFSET = {position: [-0.1, 0, 0], orientation: [0,0,0,0]}; const RIGHT_OFFSET = {position: [0.1, 0, 0], orientation: [0,0,0,0]}; - +const LEFT_VIEWPORT = {x: 0, y: 0, width: 320, height: 480}; +const RIGHT_VIEWPORT = {x: 320, y: 0, width: 320, height: 480}; let assert_matrix_approx_equals = function(m1, m2, epsilon, prefix = "") { assert_equals(m1.length, m2.length, prefix + "Matrix lengths should match"); for(var i = 0; i < m1.length; ++i) { @@ -12,6 +13,6 @@ let assert_matrix_approx_equals = function(m1, m2, epsilon, prefix = "") { } const TEST_VIEWS = [ - {eye: "left", projectionMatrix: VALID_PROJECTION_MATRIX, viewOffset: LEFT_OFFSET}, - {eye: "right", projectionMatrix: VALID_PROJECTION_MATRIX, viewOffset: RIGHT_OFFSET} + {eye: "left", projectionMatrix: VALID_PROJECTION_MATRIX, viewOffset: LEFT_OFFSET, viewport: LEFT_VIEWPORT}, + {eye: "right", projectionMatrix: VALID_PROJECTION_MATRIX, viewOffset: RIGHT_OFFSET, viewport: RIGHT_VIEWPORT} ]; |