mirror of
https://github.com/servo/servo.git
synced 2025-08-13 17:35:36 +01:00
Update web-platform-tests to revision fd0429f0b45f975b25d85256dac33762134952c5
This commit is contained in:
parent
0ba7da4431
commit
c8202ddbe1
50 changed files with 1210 additions and 191 deletions
|
@ -3,40 +3,53 @@
|
|||
<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) => {
|
||||
Promise.all([
|
||||
return Promise.all([
|
||||
navigator.xr.requestSession({ mode: 'inline'}),
|
||||
navigator.xr.requestSession({ mode: 'inline'})
|
||||
]).then((sessions) => {
|
||||
assert_not_equals(sessions[0], null);
|
||||
assert_not_equals(sessions[1], null);
|
||||
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(session, gl),
|
||||
baseLayer: new XRWebGLLayer(sessions[0], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
sessions[0].requestAnimationFrame((time, xrFrame) => {
|
||||
sessions[1].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(session, gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
return new Promise((resolve, reject) => {
|
||||
sessions[0].requestAnimationFrame((time, xrFrame) => {
|
||||
sessions[1].updateRenderState({
|
||||
baseLayer: new XRWebGLLayer(sessions[1], gl),
|
||||
outputContext: outputContext
|
||||
});
|
||||
|
||||
// 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);
|
||||
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) => {
|
||||
// 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);
|
||||
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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue