Changeset 260424 in webkit
- Timestamp:
- Apr 21, 2020 3:33:58 AM (4 years ago)
- Location:
- trunk/LayoutTests/imported/w3c
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r260385 r260424 1 2020-04-21 Sergio Villar Senin <svillar@igalia.com> 2 3 Import latest changes from web-platform-test/webxr/resources to enable testing in WebKit 4 https://bugs.webkit.org/show_bug.cgi?id=210788 5 6 Reviewed by Žan Doberšek. 7 8 We landed in wpt new code in webxr_utils.js to map internal.xrTest to 9 navigator.xr.test to be able to run WebXR WPT in WebKit. Import those changes 10 from upstream in order to be able to run the tests. 11 12 Apart from that we take the chance to import the latest fixes to the 13 files in resources/ directory. 14 15 * web-platform-tests/webxr/resources/webxr_test_constants.js: Updated. 16 * web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js: 17 (createFakeWorld): Ditto. 18 * web-platform-tests/webxr/resources/webxr_util.js: Map internals.xrTest 19 to navigator.xr.test for WebKit browsers. 20 (xr_debug): Updated. 21 (async xr_session_promise_test): Ditto. 22 (xr_promise_test): Deleted. 23 1 24 2020-04-15 Sergio Villar Senin <svillar@igalia.com> 2 25 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants.js
r258499 r260424 129 129 'hit-test', 130 130 'dom-overlay', 131 'light-estimation', 131 132 ]; 132 133 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_test_constants_fake_world.js
r258499 r260424 30 30 const FRONT_WALL_AND_FLOOR_FACES = [ 31 31 // Front wall: 32 [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT],33 [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT],32 { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT] }, 33 { vertices: [BOTTOM_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_LEFT_FRONT] }, 34 34 // Floor: 35 [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK],36 [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK],35 { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK] }, 36 { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, BOTTOM_RIGHT_BACK] }, 37 37 ]; 38 38 39 39 const CEILING_FACES = [ 40 40 // Ceiling: 41 [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK],42 [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK],41 { vertices: [TOP_LEFT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] }, 42 { vertices: [TOP_LEFT_FRONT, TOP_LEFT_BACK, TOP_RIGHT_BACK] }, 43 43 ]; 44 44 45 45 const SIDE_WALLS_FACES = [ 46 46 // Left: 47 [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK],48 [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK],47 { vertices: [BOTTOM_LEFT_FRONT, TOP_LEFT_FRONT, TOP_LEFT_BACK] }, 48 { vertices: [BOTTOM_LEFT_FRONT, BOTTOM_LEFT_BACK, TOP_LEFT_BACK] }, 49 49 // Right: 50 [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK],51 [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK],50 { vertices: [BOTTOM_RIGHT_FRONT, TOP_RIGHT_FRONT, TOP_RIGHT_BACK] }, 51 { vertices: [BOTTOM_RIGHT_FRONT, BOTTOM_RIGHT_BACK, TOP_RIGHT_BACK] }, 52 52 ]; 53 53 -
trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/resources/webxr_util.js
r258499 r260424 8 8 // --enable-blink-features=MojoJS,MojoJSTest 9 9 10 // Debugging message helper, by default does nothing. Implementations can 11 // override this. 12 var xr_debug = function(name, msg) {} 13 10 14 function xr_promise_test(name, func, properties) { 11 15 promise_test(async (t) => { 12 16 // Perform any required test setup: 17 xr_debug(name, 'setup'); 13 18 14 19 if (window.XRTest === undefined) { 15 20 // Chrome setup 16 21 await loadChromiumResources; 22 xr_debug = navigator.xr.test.Debug; 23 } 24 25 if (self.internals && internals.xrTest && navigator.xr) { 26 // WebKit setup 27 await setupWebKitWebXRTestAPI; 17 28 } 18 29 … … 23 34 t.add_cleanup(async () => { 24 35 // Ensure system state is cleaned up. 36 xr_debug(name, 'cleanup'); 25 37 await navigator.xr.test.disconnectAllDevices(); 26 38 }); 27 39 40 xr_debug(name, 'main'); 28 41 return func(t); 29 42 }, name, properties); … … 75 88 .then(() => new Promise((resolve, reject) => { 76 89 // Perform the session request in a user gesture. 90 xr_debug(name, 'simulateUserActivation'); 77 91 navigator.xr.test.simulateUserActivation(() => { 92 xr_debug(name, 'document.hasFocus()=' + document.hasFocus()); 78 93 navigator.xr.requestSession(sessionMode, sessionInit || {}) 79 94 .then((session) => { 95 xr_debug(name, 'session start'); 80 96 testSession = session; 81 97 session.mode = sessionMode; … … 88 104 }); 89 105 sessionObjects.glLayer = glLayer; 106 xr_debug(name, 'session.visibilityState=' + session.visibilityState); 90 107 resolve(func(session, testDeviceController, t, sessionObjects)); 91 108 }) 92 109 .catch((err) => { 110 xr_debug(name, 'error: ' + err); 93 111 reject( 94 112 'Session with params ' + … … 187 205 return chain; 188 206 }); 207 208 let setupWebKitWebXRTestAPI = Promise.resolve().then(() => { 209 if (!self.internals) { 210 // Do nothing on non-WebKit-based browsers. 211 return; 212 } 213 214 // WebKit setup. The internals object is used by the WebKit test runner 215 // to provide JS access to internal APIs. In this case it's used to 216 // ensure that XRTest is only exposed to wpt tests. 217 navigator.xr.test = internals.xrTest; 218 return Promise.resolve(); 219 });
Note: See TracChangeset
for help on using the changeset viewer.