Fix test timing for all tests using xr_promise_test (#33715)

* Ensure all xr_promise_test calls wait for DOMContentLoaded when necessary.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update webxr test expectations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Update manifest.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2024-10-09 08:13:11 -04:00 committed by GitHub
parent af61b1a107
commit 3eee02869a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 28 additions and 33 deletions

View file

@ -500723,7 +500723,7 @@
[]
],
"webxr_util.js": [
"824aee5700a15d518a113bbbcaab7bdf92d187e2",
"ab8f7c80c31fc7bc827bd61abf13e095e53b48cd",
[]
]
},

View file

@ -1 +1 @@
prefs: [dom.webxr.test: true, dom.webgl2.enabled: true]
prefs: [dom.webxr.test: true, dom.webgl2.enabled: true, dom.webxr.layers.enabled: true]

View file

@ -1,7 +1,7 @@
[depth_sensing_cpu_dataUnavailable.https.html]
expected: ERROR
[Ensures depth data is not available when cleared in the controller, `cpu-optimized` - webgl]
expected: FAIL
[Ensures depth data is not available when cleared in the controller, `cpu-optimized` - webgl2]
expected: FAIL

View file

@ -1,7 +1,7 @@
[depth_sensing_cpu_inactiveFrame.https.html]
expected: ERROR
[Ensures getDepthInformation() throws when not run in an active frame, `cpu-optimized` - webgl]
expected: FAIL
[Ensures getDepthInformation() throws when not run in an active frame, `cpu-optimized` - webgl2]
expected: FAIL

View file

@ -1,7 +1,7 @@
[depth_sensing_cpu_incorrectUsage.https.html]
expected: ERROR
[Ensures XRWebGLDepthInformation is not obtainable in `cpu-optimized` usage mode - webgl]
expected: FAIL
[Ensures XRWebGLDepthInformation is not obtainable in `cpu-optimized` usage mode - webgl2]
expected: FAIL

View file

@ -1,7 +1,7 @@
[depth_sensing_cpu_staleView.https.html]
expected: ERROR
[Ensures getDepthInformation() throws when run with stale XRView, `cpu-optimized` - webgl]
expected: FAIL
[Ensures getDepthInformation() throws when run with stale XRView, `cpu-optimized` - webgl2]
expected: FAIL

View file

@ -1,7 +1,7 @@
[depth_sensing_gpu_dataUnavailable.https.html]
expected: ERROR
[Ensures depth data is not available when cleared in the controller, `gpu-optimized` - webgl]
expected: FAIL
[Ensures depth data is not available when cleared in the controller, `gpu-optimized` - webgl2]
expected: FAIL

View file

@ -1,7 +1,7 @@
[depth_sensing_gpu_staleView.https.html]
expected: ERROR
[Ensures getDepthInformation() throws when not run with stale XRView, `gpu-optimized` - webgl]
expected: FAIL
[Ensures getDepthInformation() throws when not run with stale XRView, `gpu-optimized` - webgl2]
expected: FAIL

View file

@ -1,7 +1,3 @@
[xrWebGLBinding_getReflectionCubeMap.https.html]
[Test that getReflectionCubeMap returns or throws appropriately without a reflection map. - webgl]
expected: FAIL
[Test that getReflectionCubeMap returns or throws appropriately without a reflection map. - webgl2]
expected: FAIL

View file

@ -1,2 +0,0 @@
[render_state_update.https.html]
expected: ERROR

View file

@ -1,7 +1,7 @@
[xrWebGLLayer_constructor.https.html]
expected: ERROR
[Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl2]
expected: FAIL
expected: NOTRUN
[Ensure that XRWebGLLayer's constructor throws appropriate errors using webgl]
expected: FAIL
expected: TIMEOUT

View file

@ -13,6 +13,8 @@
// override this.
var xr_debug = function(name, msg) {};
let loaded = new Promise(resolve => document.addEventListener('DOMContentLoaded', resolve));
function xr_promise_test(name, func, properties, glContextType, glContextProperties) {
promise_test(async (t) => {
if (glContextType === 'webgl2') {
@ -60,6 +62,7 @@ function xr_promise_test(name, func, properties, glContextType, glContextPropert
let canvas = null;
if (glContextType) {
canvas = document.createElement('canvas');
await loaded;
document.body.appendChild(canvas);
gl = canvas.getContext(glContextType, glContextProperties);
}
@ -161,22 +164,20 @@ function xr_session_promise_test(
}));
}
document.addEventListener('DOMContentLoaded', () => {
xr_promise_test(
name + ' - webgl',
runTest,
properties,
'webgl',
{alpha: false, antialias: false, ...glcontextProperties}
);
xr_promise_test(
name + ' - webgl2',
runTest,
properties,
'webgl2',
{alpha: false, antialias: false, ...glcontextProperties}
);
});
xr_promise_test(
name + ' - webgl',
runTest,
properties,
'webgl',
{alpha: false, antialias: false, ...glcontextProperties}
);
xr_promise_test(
name + ' - webgl2',
runTest,
properties,
'webgl2',
{alpha: false, antialias: false, ...glcontextProperties}
);
}