Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js (260423 => 260424)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js 2020-04-21 10:31:08 UTC (rev 260423)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js 2020-04-21 10:33:58 UTC (rev 260424)
@@ -128,6 +128,7 @@
'unbounded',
'hit-test',
'dom-overlay',
+ 'light-estimation',
];
const TRACKED_IMMERSIVE_DEVICE = {
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js (260423 => 260424)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js 2020-04-21 10:31:08 UTC (rev 260423)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js 2020-04-21 10:33:58 UTC (rev 260424)
@@ -29,26 +29,26 @@
// Faces:
const FRONT_WALL_AND_FLOOR_FACES = [
// Front wall:
- [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT],
- [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT],
+ { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT] },
+ { vertices: [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT] },
// Floor:
- [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK],
- [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK],
+ { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK] },
+ { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK] },
];
const CEILING_FACES = [
// Ceiling:
- [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK],
- [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK],
+ { vertices: [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] },
+ { vertices: [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK] },
];
const SIDE_WALLS_FACES = [
// Left:
- [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK],
- [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK],
+ { vertices: [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK] },
+ { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK] },
// Right:
- [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK],
- [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK],
+ { vertices: [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] },
+ { vertices: [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK] },
];
// Regions:
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js (260423 => 260424)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js 2020-04-21 10:31:08 UTC (rev 260423)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js 2020-04-21 10:33:58 UTC (rev 260424)
@@ -7,15 +7,26 @@
//
// --enable-blink-features=MojoJS,MojoJSTest
+// Debugging message helper, by default does nothing. Implementations can
+// override this.
+var xr_debug = function(name, msg) {}
+
function xr_promise_test(name, func, properties) {
promise_test(async (t) => {
// Perform any required test setup:
+ xr_debug(name, 'setup');
if (window.XRTest === undefined) {
// Chrome setup
await loadChromiumResources;
+ xr_debug = navigator.xr.test.Debug;
}
+ if (self.internals && internals.xrTest && navigator.xr) {
+ // WebKit setup
+ await setupWebKitWebXRTestAPI;
+ }
+
// Ensure that any devices are disconnected when done. If this were done in
// a .then() for the success case, a test that expected failure would
// already be marked done at the time that runs and the shutdown would
@@ -22,9 +33,11 @@
// interfere with the next test.
t.add_cleanup(async () => {
// Ensure system state is cleaned up.
+ xr_debug(name, 'cleanup');
await navigator.xr.test.disconnectAllDevices();
});
+ xr_debug(name, 'main');
return func(t);
}, name, properties);
}
@@ -74,9 +87,12 @@
})
.then(() => new Promise((resolve, reject) => {
// Perform the session request in a user gesture.
+ xr_debug(name, 'simulateUserActivation');
navigator.xr.test.simulateUserActivation(() => {
+ xr_debug(name, 'document.hasFocus()=' + document.hasFocus());
navigator.xr.requestSession(sessionMode, sessionInit || {})
.then((session) => {
+ xr_debug(name, 'session start');
testSession = session;
session.mode = sessionMode;
let glLayer = new XRWebGLLayer(session, gl, gllayerProperties);
@@ -87,9 +103,11 @@
baseLayer: glLayer
});
sessionObjects.glLayer = glLayer;
+ xr_debug(name, 'session.visibilityState=' + session.visibilityState);
resolve(func(session, testDeviceController, t, sessionObjects));
})
.catch((err) => {
+ xr_debug(name, 'error: ' + err);
reject(
'Session with params ' +
JSON.stringify(sessionMode) +
@@ -186,3 +204,16 @@
return chain;
});
+
+let setupWebKitWebXRTestAPI = Promise.resolve().then(() => {
+ if (!self.internals) {
+ // Do nothing on non-WebKit-based browsers.
+ return;
+ }
+
+ // WebKit setup. The internals object is used by the WebKit test runner
+ // to provide JS access to internal APIs. In this case it's used to
+ // ensure that XRTest is only exposed to wpt tests.
+ navigator.xr.test = internals.xrTest;
+ return Promise.resolve();
+});