mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Support .supportedModes to enable newer tests
This commit is contained in:
parent
ef6ee5e2a1
commit
7f353033f4
10 changed files with 32 additions and 22 deletions
|
@ -20,7 +20,9 @@ interface XRTest {
|
||||||
};
|
};
|
||||||
|
|
||||||
dictionary FakeXRDeviceInit {
|
dictionary FakeXRDeviceInit {
|
||||||
required boolean supportsImmersive;
|
boolean supportsImmersive = false;
|
||||||
|
sequence<XRSessionMode> supportedModes;
|
||||||
|
|
||||||
required sequence<FakeXRViewInit> views;
|
required sequence<FakeXRViewInit> views;
|
||||||
|
|
||||||
// this is actually sequence<any>, but we don't support
|
// this is actually sequence<any>, but we don't support
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
use crate::dom::bindings::callback::ExceptionHandling;
|
use crate::dom::bindings::callback::ExceptionHandling;
|
||||||
use crate::dom::bindings::cell::DomRefCell;
|
use crate::dom::bindings::cell::DomRefCell;
|
||||||
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
use crate::dom::bindings::codegen::Bindings::FunctionBinding::Function;
|
||||||
|
use crate::dom::bindings::codegen::Bindings::XRSystemBinding::XRSessionMode;
|
||||||
use crate::dom::bindings::codegen::Bindings::XRTestBinding::{FakeXRDeviceInit, XRTestMethods};
|
use crate::dom::bindings::codegen::Bindings::XRTestBinding::{FakeXRDeviceInit, XRTestMethods};
|
||||||
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
use crate::dom::bindings::refcounted::{Trusted, TrustedPromise};
|
||||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
|
||||||
|
@ -119,12 +120,24 @@ impl XRTestMethods for XRTest {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let (mut supports_inline, mut supports_vr, mut supports_ar) = (false, false, false);
|
||||||
|
|
||||||
|
if let Some(ref modes) = init.supportedModes {
|
||||||
|
for mode in modes {
|
||||||
|
match mode {
|
||||||
|
XRSessionMode::Immersive_vr => supports_vr = true,
|
||||||
|
XRSessionMode::Immersive_ar => supports_ar = true,
|
||||||
|
XRSessionMode::Inline => supports_inline = true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let init = MockDeviceInit {
|
let init = MockDeviceInit {
|
||||||
viewer_origin: origin,
|
viewer_origin: origin,
|
||||||
views,
|
views,
|
||||||
supports_inline: false,
|
supports_inline,
|
||||||
supports_vr: init.supportsImmersive,
|
supports_vr,
|
||||||
supports_ar: false,
|
supports_ar,
|
||||||
floor_origin,
|
floor_origin,
|
||||||
supported_features,
|
supported_features,
|
||||||
world,
|
world,
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[xrDevice_isSessionSupported_immersive-ar.https.html]
|
|
||||||
[isSessionSupported resolves to false for immersive-ar on an unsupported device]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
[xrDevice_requestSession_immersive-ar.https.html]
|
|
||||||
[Tests requestSession rejects immersive-ar mode when unsupported]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
[ar_dom_overlay.https.html]
|
[ar_dom_overlay.https.html]
|
||||||
|
expected: ERROR
|
||||||
[Ensures DOM Overlay element selection works]
|
[Ensures DOM Overlay element selection works]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
@ -6,7 +7,7 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Ensures DOM Overlay input deduplication works]
|
[Ensures DOM Overlay input deduplication works]
|
||||||
expected: FAIL
|
expected: TIMEOUT
|
||||||
|
|
||||||
[Ensures DOM Overlay feature works for immersive-ar, body element]
|
[Ensures DOM Overlay feature works for immersive-ar, body element]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
@ -15,11 +16,11 @@
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Ensures DOM Overlay Fullscreen API doesn't change DOM overlay]
|
[Ensures DOM Overlay Fullscreen API doesn't change DOM overlay]
|
||||||
expected: FAIL
|
expected: NOTRUN
|
||||||
|
|
||||||
[Ensures DOM Overlay feature works for immersive-ar, div element]
|
[Ensures DOM Overlay feature works for immersive-ar, div element]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[Ensures DOM Overlay interactions on cross origin iframe are ignored]
|
[Ensures DOM Overlay interactions on cross origin iframe are ignored]
|
||||||
expected: FAIL
|
expected: NOTRUN
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
[ar_dom_overlay_hit_test.https.html]
|
[ar_dom_overlay_hit_test.https.html]
|
||||||
expected: ERROR
|
[Ensures DOM Overlay interactions on cross origin iframe do not cause hit test results to come up]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -14609,21 +14609,21 @@
|
||||||
},
|
},
|
||||||
"webxr": {
|
"webxr": {
|
||||||
"create_session.html": [
|
"create_session.html": [
|
||||||
"af76c5a812d7d05a0158194560933def3fbdb9f9",
|
"5b5d485b372bfffb22204bc162c9e182306395cb",
|
||||||
[
|
[
|
||||||
null,
|
null,
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"layers.html": [
|
"layers.html": [
|
||||||
"31f4b6bd51cfcca47666331857bd2bbdf84d2f5e",
|
"49821d7661f92bc9cf22232d3fcb391c2cdc7295",
|
||||||
[
|
[
|
||||||
null,
|
null,
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
"obtain_frame.html": [
|
"obtain_frame.html": [
|
||||||
"74fda5bad43e8ea95552e65380e83952680e8469",
|
"d9ff25729f9cdfd348e7c9914ce2dacd231e13a0",
|
||||||
[
|
[
|
||||||
null,
|
null,
|
||||||
{}
|
{}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<script>
|
<script>
|
||||||
async_test(function(t) {
|
async_test(function(t) {
|
||||||
navigator.xr.test.simulateDeviceConnection({
|
navigator.xr.test.simulateDeviceConnection({
|
||||||
supportsImmersive: true,
|
supportedModes: ["immersive-vr"],
|
||||||
views: TEST_VIEWS,
|
views: TEST_VIEWS,
|
||||||
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
||||||
}).then((m) => {
|
}).then((m) => {
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
let gl = canvas.getContext('webgl');
|
let gl = canvas.getContext('webgl');
|
||||||
promise_test(async function() {
|
promise_test(async function() {
|
||||||
let mock = await navigator.xr.test.simulateDeviceConnection({
|
let mock = await navigator.xr.test.simulateDeviceConnection({
|
||||||
supportsImmersive: true,
|
supportedModes: ["immersive-vr"],
|
||||||
views: TEST_VIEWS,
|
views: TEST_VIEWS,
|
||||||
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
let gl = canvas.getContext('webgl');
|
let gl = canvas.getContext('webgl');
|
||||||
promise_test(async function() {
|
promise_test(async function() {
|
||||||
let mock = await navigator.xr.test.simulateDeviceConnection({
|
let mock = await navigator.xr.test.simulateDeviceConnection({
|
||||||
supportsImmersive: true,
|
supportedModes: ["immersive-vr"],
|
||||||
views: TEST_VIEWS,
|
views: TEST_VIEWS,
|
||||||
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
viewerOrigin: {position: [0.5, 0.1, 0.1], orientation: [1, 0, 0, 1] }
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue