xrInputSource_profiles.https.html (1317B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="resources/webxr_util.js"></script> 5 <script src="resources/webxr_test_constants.js"></script> 6 7 <script> 8 let testName = "WebXR InputSource's profiles list can be set"; 9 10 let fakeDeviceInitParams = TRACKED_IMMERSIVE_DEVICE; 11 12 let testFunction = function(session, fakeDeviceController, t) { 13 14 let input_source = fakeDeviceController.simulateInputSourceConnection({ 15 handedness: "right", 16 targetRayMode: "tracked-pointer", 17 pointerOrigin: VALID_POINTER_TRANSFORM, 18 profiles: ["most-specific-name", "less-specific-name"] 19 }); 20 21 // Input events and state changes need one frame to propagate, which is why we 22 // are requesting an animation frame before checking the profiles list. 23 return new Promise((resolve) => { 24 requestSkipAnimationFrame(session, () => { 25 let profiles = session.inputSources[0].profiles; 26 t.step(() => { 27 assert_equals(profiles.length, 2); 28 assert_equals(profiles[0], "most-specific-name"); 29 assert_equals(profiles[1], "less-specific-name"); 30 }, "Verify profiles list is set"); 31 resolve(); 32 }); 33 }); 34 }; 35 36 xr_session_promise_test( 37 testName, testFunction, fakeDeviceInitParams, 'immersive-vr'); 38 </script>