mirror of
https://github.com/servo/servo.git
synced 2025-08-15 02:15:33 +01:00
Update web-platform-tests to revision 755d18230983e9c7d894768b73fabff8bc290d91
This commit is contained in:
parent
d544c186b9
commit
fa788e624b
70 changed files with 1929 additions and 380 deletions
|
@ -52,11 +52,13 @@ function xr_session_promise_test(
|
|||
.then((session) => {
|
||||
testSession = session;
|
||||
session.mode = sessionMode;
|
||||
let glLayer = new XRWebGLLayer(session, gl, {
|
||||
compositionDisabled: session.mode == 'inline'
|
||||
});
|
||||
// Session must have a baseLayer or frame requests
|
||||
// will be ignored.
|
||||
session.updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(session, gl),
|
||||
outputContext: getOutputContext()
|
||||
baseLayer: glLayer
|
||||
});
|
||||
resolve(func(session, testDeviceController, t));
|
||||
})
|
||||
|
@ -78,15 +80,6 @@ function xr_session_promise_test(
|
|||
properties);
|
||||
}
|
||||
|
||||
// A utility function to create an output context as required by non-immersive
|
||||
// sessions.
|
||||
// https://immersive-web.github.io/webxr/#xrsessioncreationoptions-interface
|
||||
function getOutputContext() {
|
||||
let outputCanvas = document.createElement('canvas');
|
||||
document.body.appendChild(outputCanvas);
|
||||
return outputCanvas.getContext('xrpresent');
|
||||
}
|
||||
|
||||
// This functions calls a callback with each API object as specified
|
||||
// by https://immersive-web.github.io/webxr/spec/latest/, allowing
|
||||
// checks to be made on all ojects.
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src=/resources/testharness.js></script>
|
||||
<script src=/resources/testharnessreport.js></script>
|
||||
<script src="resources/webxr_util.js"></script>
|
||||
<canvas></canvas>
|
||||
<script>
|
||||
xr_promise_test(
|
||||
"Ensure that XRPresentationContexts are properly transfered between session",
|
||||
(t) => {
|
||||
return XRTest.simulateDeviceConnection({ supportsImmersive:false })
|
||||
.then( (controller) => {
|
||||
return Promise.all([
|
||||
navigator.xr.requestSession('inline'),
|
||||
navigator.xr.requestSession('inline')
|
||||
]).then((sessions) => {
|
||||
t.step(() => {
|
||||
assert_not_equals(sessions[0], null);
|
||||
assert_not_equals(sessions[1], null);
|
||||
});
|
||||
|
||||
const webglCanvas = document.getElementsByTagName('canvas')[0];
|
||||
let gl = webglCanvas.getContext('webgl', {xrCompatible: true});
|
||||
let outputContext = getOutputContext();
|
||||
|
||||
sessions[0].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(sessions[0], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
sessions[0].requestAnimationFrame((time, xrFrame) => {
|
||||
sessions[1].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(sessions[1], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
t.step(() => {
|
||||
// outputContext reassignment should not happen until the next frame is processed.
|
||||
assert_equals(sessions[0].renderState.outputContext, outputContext);
|
||||
assert_equals(sessions[1].renderState.outputContext, null);
|
||||
});
|
||||
|
||||
sessions[1].requestAnimationFrame((time, xrFrame) => {
|
||||
t.step(() => {
|
||||
// Ensure the outputContext was properly reassigned from one context to the other.
|
||||
assert_equals(sessions[0].renderState.outputContext, null);
|
||||
assert_equals(sessions[1].renderState.outputContext, outputContext);
|
||||
});
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
Loading…
Add table
Add a link
Reference in a new issue