Changeset 260432 in webkit
- Timestamp:
- Apr 21, 2020 9:30:31 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 5 added
- 13 edited
- 16 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r260430 r260432 1 2020-04-21 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Test IDLs and stubs 4 https://bugs.webkit.org/show_bug.cgi?id=209859 5 6 Reviewed by Dean Jackson and Youenn Fablet. 7 8 * platform/wpe/TestExpectations: Added bug number to the passing webxr test. 9 1 10 2020-04-21 Carlos Alberto Lopez Perez <clopez@igalia.com> 2 11 -
trunk/LayoutTests/platform/wpe/TestExpectations
r260389 r260432 1023 1023 imported/w3c/web-platform-tests/css/css-text/white-space/pre-wrap-013.html [ Pass ] 1024 1024 1025 imported/w3c/web-platform-tests/webxr/idlharness.https.window.html [ Pass ] 1025 # WebXR 1026 webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/idlharness.https.window.html [ Pass ] 1026 1027 1027 1028 #//////////////////////////////////////////////////////////////////////////////////////// -
trunk/Source/WebCore/CMakeLists.txt
r260277 r260432 160 160 "${WEBCORE_DIR}/svg/graphics/filters" 161 161 "${WEBCORE_DIR}/svg/properties" 162 "${WEBCORE_DIR}/testing" 162 163 "${WEBCORE_DIR}/websockets" 163 164 "${WEBCORE_DIR}/workers" … … 1657 1658 ) 1658 1659 1660 1661 if (ENABLE_WEBXR) 1662 list(APPEND WebCoreTestSupport_IDL_FILES 1663 testing/FakeXRBoundsPoint.idl 1664 testing/FakeXRButtonStateInit.idl 1665 testing/FakeXRInputSourceInit.idl 1666 testing/FakeXRRigidTransformInit.idl 1667 testing/FakeXRViewInit.idl 1668 testing/WebFakeXRDevice.idl 1669 testing/WebFakeXRInputController.idl 1670 testing/WebXRTest.idl 1671 testing/XRSimulateUserActivationFunction.idl 1672 ) 1673 list(APPEND WebCoreTestSupport_SOURCES 1674 testing/WebFakeXRDevice.cpp 1675 testing/WebXRTest.cpp 1676 ) 1677 endif () 1678 1659 1679 # Modules that the bindings generator scripts may use 1660 1680 set(SCRIPTS_RESOLVE_SUPPLEMENTAL -
trunk/Source/WebCore/ChangeLog
r260425 r260432 1 2020-04-16 Sergio Villar Senin <svillar@igalia.com> 2 3 [WebXR] Test IDLs and stubs 4 https://bugs.webkit.org/show_bug.cgi?id=209859 5 6 Reviewed by Dean Jackson and Youenn Fablet. 7 8 WebXR testing is hard as it might involve interaction with actual 9 devices. That's why the WebXR testing 10 API (https://immersive-web.github.io/webxr-test-api/) was 11 proposed. In fact, all the current WebXR tests from 12 web-platform-tests are using that testing API. This new testing 13 API supplements navigator.xr and is accessed through 14 navigator.xr.test. 15 16 In order not to expose the API to the web we're adding the XRTest 17 interface to Internals instead. The mapping from internals.xrTest to 18 navigator.xr.test happens in the WPT code. 19 20 We're adding the required IDLs and very basic (mostly empty) 21 implementations for testing methods. We're adding testing 22 infrastructure, adding tests make no sense for this change. 23 24 * CMakeLists.txt: Added new files. 25 * DerivedSources.make: Ditto. 26 * Modules/webxr/NavigatorWebXR.h: Export API to be used in testing code. 27 * Modules/webxr/WebXRSystem.h: Export ::from and ::xr methods. 28 * Sources.txt: Added new files. 29 * WebCore.xcodeproj/project.pbxproj: Ditto. 30 * bindings/js/WebCoreBuiltinNames.h: Added some new macros. 31 * testing/FakeXRBoundsPoint.h: Added. 32 * testing/FakeXRBoundsPoint.idl: Added. 33 * testing/FakeXRButtonStateInit.h: Added. 34 * testing/FakeXRButtonStateInit.idl: Added. 35 * testing/FakeXRInputSourceInit.h: Added. 36 * testing/FakeXRInputSourceInit.idl: Added. 37 * testing/FakeXRRigidTransformInit.h: Added. 38 * testing/FakeXRRigidTransformInit.idl: Added. 39 * testing/FakeXRViewInit.h: Added. 40 * testing/FakeXRViewInit.idl: Added. 41 * testing/Internals.cpp: 42 (WebCore::Internals::xrTest): Added WebXRTest to Internals. 43 * testing/Internals.h: Added xrTest() accessor. 44 * testing/Internals.idl: Added xrTest attribute. 45 * testing/WebFakeXRDevice.cpp: Added. 46 (WebCore::WebFakeXRDevice::setViews): 47 (WebCore::WebFakeXRDevice::disconnect): 48 (WebCore::WebFakeXRDevice::setViewerOrigin): 49 (WebCore::WebFakeXRDevice::clearViewerOrigin): 50 (WebCore::WebFakeXRDevice::simulateVisibilityChange): 51 (WebCore::WebFakeXRDevice::setBoundsGeometry): 52 (WebCore::WebFakeXRDevice::setFloorOrigin): 53 (WebCore::WebFakeXRDevice::clearFloorOrigin): 54 (WebCore::WebFakeXRDevice::simulateResetPose): 55 (WebCore::WebFakeXRDevice::simulateInputSourceConnection): 56 * testing/WebFakeXRDevice.h: Added. 57 * testing/WebFakeXRDevice.idl: Added. 58 * testing/WebFakeXRInputController.cpp: Added. 59 (WebCore::WebFakeXRInputController::setHandedness): 60 (WebCore::WebFakeXRInputController::setTargetRayMode): 61 (WebCore::WebFakeXRInputController::setProfiles): 62 (WebCore::WebFakeXRInputController::setGripOrigin): 63 (WebCore::WebFakeXRInputController::clearGripOrigin): 64 (WebCore::WebFakeXRInputController::setPointerOrigin): 65 (WebCore::WebFakeXRInputController::disconnect): 66 (WebCore::WebFakeXRInputController::reconnect): 67 (WebCore::WebFakeXRInputController::startSelection): 68 (WebCore::WebFakeXRInputController::endSelection): 69 (WebCore::WebFakeXRInputController::simulateSelect): 70 (WebCore::WebFakeXRInputController::setSupportedButtons): 71 (WebCore::WebFakeXRInputController::updateButtonState): 72 * testing/WebFakeXRInputController.h: Added. 73 * testing/WebFakeXRInputController.idl: Added. 74 * testing/WebXRTest.cpp: Added. 75 (WebCore::WebXRTest::simulateDeviceConnection const): 76 (WebCore::WebXRTest::simulateUserActivation): 77 (WebCore::WebXRTest::disconnectAllDevices): 78 * testing/WebXRTest.h: Added. 79 (WebCore::WebXRTest::create): 80 * testing/WebXRTest.idl: Added. 81 * testing/XRSimulateUserActivationFunction.h: Added. 82 * testing/XRSimulateUserActivationFunction.idl: Ditto. 83 1 84 2020-04-21 Claudio Saavedra <csaavedra@igalia.com> 2 85 -
trunk/Source/WebCore/DerivedSources.make
r260243 r260432 1119 1119 $(WebCore)/testing/ServiceWorkerInternals.idl \ 1120 1120 $(WebCore)/testing/TypeConversions.idl \ 1121 $(WebCore)/testing/FakeXRBoundsPoint.idl \ 1122 $(WebCore)/testing/FakeXRButtonStateInit.idl \ 1123 $(WebCore)/testing/FakeXRInputSourceInit.idl \ 1124 $(WebCore)/testing/FakeXRRigidTransformInit.idl \ 1125 $(WebCore)/testing/FakeXRViewInit.idl \ 1126 $(WebCore)/testing/WebFakeXRDevice.idl \ 1127 $(WebCore)/testing/WebFakeXRInputController.idl \ 1128 $(WebCore)/testing/WebXRTest.idl \ 1129 $(WebCore)/testing/XRSimulateUserActivationFunction.idl \ 1121 1130 $(WebCore)/workers/AbstractWorker.idl \ 1122 1131 $(WebCore)/workers/DedicatedWorkerGlobalScope.idl \ -
trunk/Source/WebCore/Modules/webxr/NavigatorWebXR.h
r258498 r260432 40 40 WTF_MAKE_FAST_ALLOCATED; 41 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 42 WEBCORE_EXPORT static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 WEBCORE_EXPORT static NavigatorWebXR& from(Navigator&); 43 45 44 46 private: 45 static NavigatorWebXR& from(Navigator&);46 47 47 RefPtr<WebXRSystem> m_xr; 48 48 }; -
trunk/Source/WebCore/Modules/webxr/WebXRSystem.h
r260415 r260432 34 34 #include <wtf/IsoMalloc.h> 35 35 #include <wtf/RefCounted.h> 36 #include <wtf/WeakPtr.h> 36 37 37 38 namespace WebCore { … … 41 42 struct XRSessionInit; 42 43 43 class WebXRSystem final : public RefCounted<WebXRSystem>, public EventTargetWithInlineData, public ActiveDOMObject {44 class WebXRSystem final : public RefCounted<WebXRSystem>, public EventTargetWithInlineData, public ActiveDOMObject, public CanMakeWeakPtr<WebXRSystem> { 44 45 WTF_MAKE_ISO_ALLOCATED(WebXRSystem); 45 46 public: … … 48 49 49 50 static Ref<WebXRSystem> create(ScriptExecutionContext&); 50 virtual~WebXRSystem();51 ~WebXRSystem(); 51 52 52 53 using RefCounted<WebXRSystem>::ref; … … 56 57 void requestSession(XRSessionMode, const XRSessionInit&, RequestSessionPromise&&); 57 58 58 private: 59 WebXRSystem(ScriptExecutionContext&); 60 59 protected: 61 60 // EventTarget 62 61 EventTargetInterface eventTargetInterface() const override { return WebXRSystemEventTargetInterfaceType; } … … 68 67 const char* activeDOMObjectName() const override; 69 68 void stop() override; 69 70 private: 71 WebXRSystem(ScriptExecutionContext&); 70 72 }; 71 73 -
trunk/Source/WebCore/Sources.txt
r260243 r260432 434 434 Modules/webxr/XRReferenceSpaceEvent.cpp @no-unify 435 435 Modules/webxr/XRSessionEvent.cpp @no-unify 436 437 testing/WebFakeXRDevice.cpp @no-unify 438 testing/WebFakeXRInputController.cpp @no-unify 439 testing/WebXRTest.cpp @no-unify 436 440 437 441 #endif … … 3559 3563 #if ENABLE_WEBXR 3560 3564 3565 JSFakeXRBoundsPoint.cpp 3566 JSFakeXRButtonStateInit.cpp 3567 JSFakeXRInputSourceInit.cpp 3568 JSFakeXRRigidTransformInit.cpp 3569 JSFakeXRViewInit.cpp 3570 JSWebFakeXRDevice.cpp 3571 JSWebFakeXRInputController.cpp 3572 JSWebXRTest.cpp 3573 JSXRSimulateUserActivationFunction.cpp 3574 3561 3575 JSWebXRBoundedReferenceSpace.cpp 3562 3576 JSXREnvironmentBlendMode.cpp -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r260311 r260432 15149 15149 E18C35411F7196CD00FF632D /* WebArchiveResourceWebResourceHandler.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebArchiveResourceWebResourceHandler.h; sourceTree = "<group>"; }; 15150 15150 E18C35421F71970100FF632D /* WebArchiveResourceWebResourceHandler.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = WebArchiveResourceWebResourceHandler.mm; sourceTree = "<group>"; }; 15151 E18D83DC243F71CB009247D6 /* FakeXRInputSourceInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FakeXRInputSourceInit.idl; sourceTree = "<group>"; }; 15152 E18D83DD243F71CC009247D6 /* WebFakeXRInputController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFakeXRInputController.cpp; sourceTree = "<group>"; }; 15153 E18D83DE243F71CD009247D6 /* FakeXRButtonStateInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeXRButtonStateInit.h; sourceTree = "<group>"; }; 15154 E18D83DF243F71CD009247D6 /* FakeXRViewInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeXRViewInit.h; sourceTree = "<group>"; }; 15155 E18D83E0243F71CE009247D6 /* WebXRTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRTest.cpp; sourceTree = "<group>"; }; 15156 E18D83E1243F71CE009247D6 /* WebFakeXRInputController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebFakeXRInputController.idl; sourceTree = "<group>"; }; 15157 E18D83E2243F71CF009247D6 /* FakeXRViewInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FakeXRViewInit.idl; sourceTree = "<group>"; }; 15158 E18D83E3243F71CF009247D6 /* FakeXRButtonStateInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FakeXRButtonStateInit.idl; sourceTree = "<group>"; }; 15159 E18D83E4243F71D0009247D6 /* FakeXRBoundsPoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeXRBoundsPoint.h; sourceTree = "<group>"; }; 15160 E18D83E5243F71D1009247D6 /* FakeXRRigidTransformInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeXRRigidTransformInit.h; sourceTree = "<group>"; }; 15161 E18D83E6243F71D1009247D6 /* FakeXRRigidTransformInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FakeXRRigidTransformInit.idl; sourceTree = "<group>"; }; 15162 E18D83E7243F71D2009247D6 /* WebFakeXRDevice.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebFakeXRDevice.idl; sourceTree = "<group>"; }; 15163 E18D83E8243F71D2009247D6 /* WebXRTest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRTest.h; sourceTree = "<group>"; }; 15164 E18D83E9243F71D3009247D6 /* WebFakeXRDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFakeXRDevice.cpp; sourceTree = "<group>"; }; 15165 E18D83EA243F71D4009247D6 /* FakeXRInputSourceInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FakeXRInputSourceInit.h; sourceTree = "<group>"; }; 15166 E18D83EB243F71D5009247D6 /* WebXRTest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRTest.idl; sourceTree = "<group>"; }; 15167 E18D83EC243F71D5009247D6 /* XRSimulateUserActivationFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRSimulateUserActivationFunction.h; sourceTree = "<group>"; }; 15168 E18D83ED243F71D6009247D6 /* WebFakeXRDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFakeXRDevice.h; sourceTree = "<group>"; }; 15169 E18D83EE243F71D7009247D6 /* WebFakeXRInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFakeXRInputController.h; sourceTree = "<group>"; }; 15170 E18D83EF243F71D7009247D6 /* FakeXRBoundsPoint.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = FakeXRBoundsPoint.idl; sourceTree = "<group>"; }; 15171 E18D83F0243F71D8009247D6 /* XRSimulateUserActivationFunction.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSimulateUserActivationFunction.idl; sourceTree = "<group>"; }; 15151 15172 E18DF33418AAF12C00773E59 /* SerializedCryptoKeyWrap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SerializedCryptoKeyWrap.h; sourceTree = "<group>"; }; 15152 15173 E18DF33618AAF14D00773E59 /* SerializedCryptoKeyWrapMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = SerializedCryptoKeyWrapMac.mm; sourceTree = "<group>"; }; 15174 E19490862434F15800416A99 /* WebXRView.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRView.idl; sourceTree = "<group>"; }; 15175 E19490872434F15900416A99 /* WebXRViewport.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRViewport.idl; sourceTree = "<group>"; }; 15176 E19490882434F15900416A99 /* WebXRFrame.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRFrame.idl; sourceTree = "<group>"; }; 15177 E19490892434F15A00416A99 /* WebXRInputSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRInputSource.idl; sourceTree = "<group>"; }; 15178 E194908F2434F15D00416A99 /* WebXRWebGLLayer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRWebGLLayer.idl; sourceTree = "<group>"; }; 15179 E19490932434F16000416A99 /* WebXRInputSourceArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRInputSourceArray.idl; sourceTree = "<group>"; }; 15180 E19490942434F16000416A99 /* WebXRBoundedReferenceSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRBoundedReferenceSpace.idl; sourceTree = "<group>"; }; 15181 E19490952434F16100416A99 /* WebXRWebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRWebGLLayer.h; sourceTree = "<group>"; }; 15182 E19490982434F16200416A99 /* WebXRRigidTransform.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRRigidTransform.idl; sourceTree = "<group>"; }; 15183 E194909A2434F16400416A99 /* WebXRSystem.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRSystem.idl; sourceTree = "<group>"; }; 15184 E194909C2434F16500416A99 /* WebXRViewerPose.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRViewerPose.idl; sourceTree = "<group>"; }; 15185 E194909E2434F16600416A99 /* WebXRSession.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRSession.idl; sourceTree = "<group>"; }; 15186 E19490A12434F16800416A99 /* WebXRPose.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRPose.idl; sourceTree = "<group>"; }; 15187 E19490A22434F16800416A99 /* WebXRSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRSpace.idl; sourceTree = "<group>"; }; 15188 E19490A42434F16900416A99 /* WebXRRenderState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRRenderState.idl; sourceTree = "<group>"; }; 15189 E19490A62434F16B00416A99 /* WebXRReferenceSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebXRReferenceSpace.idl; sourceTree = "<group>"; }; 15153 15190 E19727151820549E00592D51 /* CryptoKeyType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CryptoKeyType.h; sourceTree = "<group>"; }; 15154 15191 E19AC3E61824DC7900349426 /* CryptoAlgorithmSHA224.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CryptoAlgorithmSHA224.cpp; sourceTree = "<group>"; }; … … 18326 18363 A1763F3B1E2051AB001D58DE /* cocoa */, 18327 18364 41815C1B138319630057AAA4 /* js */, 18365 E18D83E4243F71D0009247D6 /* FakeXRBoundsPoint.h */, 18366 E18D83EF243F71D7009247D6 /* FakeXRBoundsPoint.idl */, 18367 E18D83DE243F71CD009247D6 /* FakeXRButtonStateInit.h */, 18368 E18D83E3243F71CF009247D6 /* FakeXRButtonStateInit.idl */, 18369 E18D83EA243F71D4009247D6 /* FakeXRInputSourceInit.h */, 18370 E18D83DC243F71CB009247D6 /* FakeXRInputSourceInit.idl */, 18371 E18D83E5243F71D1009247D6 /* FakeXRRigidTransformInit.h */, 18372 E18D83E6243F71D1009247D6 /* FakeXRRigidTransformInit.idl */, 18373 E18D83DF243F71CD009247D6 /* FakeXRViewInit.h */, 18374 E18D83E2243F71CF009247D6 /* FakeXRViewInit.idl */, 18328 18375 51714EA91CF65899004723C4 /* GCObservation.cpp */, 18329 18376 51714EAA1CF65899004723C4 /* GCObservation.h */, … … 18390 18437 EB081CD91696084400553730 /* TypeConversions.idl */, 18391 18438 E1BA67191742BEF400C20251 /* WebCoreTestShimLibrary.cpp */, 18439 E18D83E9243F71D3009247D6 /* WebFakeXRDevice.cpp */, 18440 E18D83ED243F71D6009247D6 /* WebFakeXRDevice.h */, 18441 E18D83E7243F71D2009247D6 /* WebFakeXRDevice.idl */, 18442 E18D83DD243F71CC009247D6 /* WebFakeXRInputController.cpp */, 18443 E18D83EE243F71D7009247D6 /* WebFakeXRInputController.h */, 18444 E18D83E1243F71CE009247D6 /* WebFakeXRInputController.idl */, 18445 E18D83E0243F71CE009247D6 /* WebXRTest.cpp */, 18446 E18D83E8243F71D2009247D6 /* WebXRTest.h */, 18447 E18D83EB243F71D5009247D6 /* WebXRTest.idl */, 18448 E18D83EC243F71D5009247D6 /* XRSimulateUserActivationFunction.h */, 18449 E18D83F0243F71D8009247D6 /* XRSimulateUserActivationFunction.idl */, 18392 18450 ); 18393 18451 path = testing; … … 27222 27280 E1EE8AD32412B17000E794D6 /* WebXRBoundedReferenceSpace.cpp */, 27223 27281 E1EE8AD12412B17000E794D6 /* WebXRBoundedReferenceSpace.h */, 27282 E19490942434F16000416A99 /* WebXRBoundedReferenceSpace.idl */, 27224 27283 E1EE8AF02412B17000E794D6 /* WebXRFrame.cpp */, 27225 27284 E1EE8AE32412B17000E794D6 /* WebXRFrame.h */, 27285 E19490882434F15900416A99 /* WebXRFrame.idl */, 27226 27286 E1EE8B0D2412B17000E794D6 /* WebXRInputSource.cpp */, 27227 27287 E1EE8B172412B17000E794D6 /* WebXRInputSource.h */, 27288 E19490892434F15A00416A99 /* WebXRInputSource.idl */, 27228 27289 E1EE8AE62412B17000E794D6 /* WebXRInputSourceArray.cpp */, 27229 27290 E1EE8ADD2412B17000E794D6 /* WebXRInputSourceArray.h */, 27291 E19490932434F16000416A99 /* WebXRInputSourceArray.idl */, 27230 27292 E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */, 27231 27293 E1EE8AE12412B17000E794D6 /* WebXRPose.h */, 27294 E19490A12434F16800416A99 /* WebXRPose.idl */, 27232 27295 E1EE8AD22412B17000E794D6 /* WebXRReferenceSpace.cpp */, 27233 27296 E1EE8B142412B17000E794D6 /* WebXRReferenceSpace.h */, 27297 E19490A62434F16B00416A99 /* WebXRReferenceSpace.idl */, 27234 27298 E1EE8ACE2412B17000E794D6 /* WebXRRenderState.cpp */, 27235 27299 E1EE8AD52412B17000E794D6 /* WebXRRenderState.h */, 27300 E19490A42434F16900416A99 /* WebXRRenderState.idl */, 27236 27301 E1EE8ACD2412B17000E794D6 /* WebXRRigidTransform.cpp */, 27237 27302 E1EE8B062412B17000E794D6 /* WebXRRigidTransform.h */, 27303 E19490982434F16200416A99 /* WebXRRigidTransform.idl */, 27238 27304 E1EE8B0F2412B17000E794D6 /* WebXRSession.cpp */, 27239 27305 E1EE8B112412B17000E794D6 /* WebXRSession.h */, 27306 E194909E2434F16600416A99 /* WebXRSession.idl */, 27240 27307 E1EE8AF82412B17000E794D6 /* WebXRSpace.cpp */, 27241 27308 E1EE8ACF2412B17000E794D6 /* WebXRSpace.h */, 27309 E19490A22434F16800416A99 /* WebXRSpace.idl */, 27242 27310 E1EE8AE82412B17000E794D6 /* WebXRSystem.cpp */, 27243 27311 E1EE8AE22412B17000E794D6 /* WebXRSystem.h */, 27312 E194909A2434F16400416A99 /* WebXRSystem.idl */, 27244 27313 E1EE8B122412B17000E794D6 /* WebXRView.cpp */, 27245 27314 E1EE8AE02412B17000E794D6 /* WebXRView.h */, 27315 E19490862434F15800416A99 /* WebXRView.idl */, 27246 27316 E1EE8B0B2412B17000E794D6 /* WebXRViewerPose.cpp */, 27247 27317 E1EE8AC72412B16F00E794D6 /* WebXRViewerPose.h */, 27318 E194909C2434F16500416A99 /* WebXRViewerPose.idl */, 27248 27319 E1EE8AEB2412B17000E794D6 /* WebXRViewport.cpp */, 27249 27320 E1EE8AF42412B17000E794D6 /* WebXRViewport.h */, 27321 E19490872434F15900416A99 /* WebXRViewport.idl */, 27250 27322 E1EE8AD82412B17000E794D6 /* WebXRWebGLLayer.cpp */, 27323 E19490952434F16100416A99 /* WebXRWebGLLayer.h */, 27324 E194908F2434F15D00416A99 /* WebXRWebGLLayer.idl */, 27251 27325 E1EE8AF72412B17000E794D6 /* XRBoundedReferenceSpace.idl */, 27252 27326 E1EE8B052412B17000E794D6 /* XREnvironmentBlendMode.h */, -
trunk/Source/WebCore/bindings/js/WebCoreBuiltinNames.h
r260385 r260432 76 76 macro(ExtendableEvent) \ 77 77 macro(ExtendableMessageEvent) \ 78 macro(FakeXRDevice) \ 79 macro(FakeXRInputController) \ 78 80 macro(FetchEvent) \ 79 81 macro(FileSystem) \ … … 252 254 macro(XRSessionEvent) \ 253 255 macro(XRSpace) \ 256 macro(XRTest) \ 254 257 macro(XRView) \ 255 258 macro(XRViewerPose) \ -
trunk/Source/WebCore/testing/FakeXRBoundsPoint.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h"31 #include <wtf/RefPtr.h>32 33 30 namespace WebCore { 34 31 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 32 struct FakeXRBoundsPoint { 33 double x; 34 double z; 48 35 }; 49 36 -
trunk/Source/WebCore/testing/FakeXRBoundsPoint.idl
r260431 r260432 24 24 */ 25 25 26 #pragma once 27 28 #if ENABLE(WEBXR) 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 32 33 namespace WebCore { 34 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 26 [ 27 EnabledAtRuntime=WebXR, 28 Conditional=WEBXR, 29 ] dictionary FakeXRBoundsPoint { 30 double x; double z; 48 31 }; 49 50 } // namespace WebCore51 52 #endif // ENABLE(WEBXR) -
trunk/Source/WebCore/testing/FakeXRButtonStateInit.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h"31 #include <wtf/RefPtr.h>32 33 30 namespace WebCore { 34 31 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 32 struct FakeXRButtonStateInit { 33 enum class Type { 34 Grip, 35 Touchpad, 36 Thumbstick, 37 OptionalButton, 38 OptionalThumbstick 39 }; 38 40 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 41 Type buttonType; 42 bool pressed; 43 bool touched; 44 float pressedValue; 45 float xValue { 0.0 }; 46 float yValue { 0.0 }; 48 47 }; 49 48 -
trunk/Source/WebCore/testing/FakeXRButtonStateInit.idl
r260431 r260432 24 24 */ 25 25 26 #pragma once 27 28 #if ENABLE(WEBXR) 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 32 33 namespace WebCore { 34 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 26 // Because the primary button is always guaranteed to be present, and other buttons 27 // should fulfill the role of validating any state from FakeXRButtonStateInit 28 // the primary button is not present in this enum. 29 [ 30 EnabledAtRuntime=WebXR, 31 Conditional=WEBXR, 32 ] enum FakeXRButtonType { 33 "grip", 34 "touchpad", 35 "thumbstick", 36 // Represents a button whose position is not specified by the xr-standard mapping. 37 // Should appear at one past the last reserved button index. 38 "optional-button", 39 // Represents a thumbstick whose position is not specified by the xr-standard mapping. 40 // Should appear at two past the last reserved button index. 41 "optional-thumbstick" 48 42 }; 49 43 50 } // namespace WebCore 51 52 #endif // ENABLE(WEBXR) 44 // Used to update the state of optionally supported buttons. 45 [ 46 EnabledAtRuntime=WebXR, 47 Conditional=WEBXR, 48 ] dictionary FakeXRButtonStateInit { 49 required FakeXRButtonType buttonType; 50 required boolean pressed; 51 required boolean touched; 52 required float pressedValue; 53 // x and y value are ignored if the FakeXRButtonType is not touchpad, thumbstick, or optional-thumbstick 54 float xValue = 0.0; 55 float yValue = 0.0; 56 }; -
trunk/Source/WebCore/testing/FakeXRInputSourceInit.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include "FakeXRButtonStateInit.h" 31 #include "FakeXRRigidTransformInit.h" 32 #include "XREye.h" 33 #include "XRHandedness.h" 34 #include "XRTargetRayMode.h" 35 #include <wtf/Vector.h> 32 36 33 37 namespace WebCore { 34 38 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 39 struct FakeXRInputSourceInit { 40 XRHandedness handedness; 41 XRTargetRayMode targetRayMode; 42 FakeXRRigidTransformInit pointerOrigin; 43 Vector<String> profiles; 44 bool selectionStarted { false }; 45 bool selectionClicked { false }; 46 Vector<FakeXRButtonStateInit> supportedButtons; 47 FakeXRRigidTransformInit gripOrigin; 48 48 }; 49 49 -
trunk/Source/WebCore/testing/FakeXRInputSourceInit.idl
r260431 r260432 24 24 */ 25 25 26 #pragma once 27 28 #if ENABLE(WEBXR) 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 32 33 namespace WebCore { 34 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 26 [ 27 EnabledAtRuntime=WebXR, 28 Conditional=WEBXR, 29 ] dictionary FakeXRInputSourceInit { 30 required XRHandedness handedness; 31 required XRTargetRayMode targetRayMode; 32 required FakeXRRigidTransformInit pointerOrigin; 33 required sequence<DOMString> profiles; 34 // was the primary action pressed when this was connected? 35 boolean selectionStarted = false; 36 // should this input source send a select immediately upon connection? 37 boolean selectionClicked = false; 38 // Initial button state for any buttons beyond the primary that are supported. 39 // If empty, only the primary button is supported. 40 // Note that if any FakeXRButtonType is repeated the behavior is undefined. 41 sequence<FakeXRButtonStateInit> supportedButtons; 42 // If not set the controller is assumed to not be tracked. 43 FakeXRRigidTransformInit gripOrigin; 48 44 }; 49 50 } // namespace WebCore51 52 #endif // ENABLE(WEBXR) -
trunk/Source/WebCore/testing/FakeXRRigidTransformInit.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include <wtf/Vector.h> 32 31 33 32 namespace WebCore { 34 33 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 34 struct FakeXRRigidTransformInit { 35 Vector<float> position; 36 Vector<float> orientation; 48 37 }; 49 38 -
trunk/Source/WebCore/testing/FakeXRRigidTransformInit.idl
r260431 r260432 24 24 */ 25 25 26 #pragma once 27 28 #if ENABLE(WEBXR) 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 32 33 namespace WebCore { 34 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 38 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 26 // https://immersive-web.github.io/webxr/#xrrigidtransform 27 [ 28 EnabledAtRuntime=WebXR, 29 Conditional=WEBXR, 30 ] dictionary FakeXRRigidTransformInit { 31 // must have three elements 32 required sequence<float> position; 33 // must have four elements 34 required sequence<float> orientation; 48 35 }; 49 50 } // namespace WebCore51 52 #endif // ENABLE(WEBXR) -
trunk/Source/WebCore/testing/FakeXRViewInit.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include "FakeXRRigidTransformInit.h" 31 #include "XREye.h" 32 #include <wtf/Vector.h> 32 33 33 34 namespace WebCore { 34 35 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 36 struct FakeXRViewInit { 37 struct DeviceResolution { 38 int width; 39 int height; 40 }; 41 struct FieldOfViewInit { 42 float upDegrees; 43 float downDegrees; 44 float leftDegrees; 45 float rightDegrees; 46 }; 38 47 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 48 XREye eye; 49 Vector<float> projectionMatrix; 50 DeviceResolution resolution; 51 FakeXRRigidTransformInit viewOffset; 52 FieldOfViewInit fieldOfView; 48 53 }; 49 54 -
trunk/Source/WebCore/testing/Internals.cpp
r260380 r260432 311 311 #endif 312 312 313 #if ENABLE(WEBXR) 314 #include "NavigatorWebXR.h" 315 #include "WebXRSystem.h" 316 #include "WebXRTest.h" 317 #endif 318 313 319 #if PLATFORM(MAC) && USE(LIBWEBRTC) 314 320 #include <webrtc/sdk/WebKit/VideoProcessingSoftLink.h> … … 5656 5662 } 5657 5663 5664 #if ENABLE(WEBXR) 5665 5666 ExceptionOr<RefPtr<WebXRTest>> Internals::xrTest() 5667 { 5668 if (!RuntimeEnabledFeatures::sharedFeatures().webXREnabled()) 5669 return Exception { InvalidAccessError }; 5670 5671 if (!m_xrTest) { 5672 if (!contextDocument() || !contextDocument()->domWindow()) 5673 return Exception { InvalidAccessError }; 5674 5675 auto* navigator = contextDocument()->domWindow()->optionalNavigator(); 5676 if (!navigator) 5677 return Exception { InvalidAccessError }; 5678 5679 auto& navigatorXR = NavigatorWebXR::from(*navigator); 5680 auto& xrSystem = navigatorXR.xr(*scriptExecutionContext(), *navigator); 5681 5682 m_xrTest = WebXRTest::create(makeWeakPtr(&xrSystem)); 5683 } 5684 return m_xrTest.get(); 5685 } 5686 5687 #endif 5688 5689 5658 5690 } // namespace WebCore -
trunk/Source/WebCore/testing/Internals.h
r260380 r260432 118 118 #endif 119 119 120 #if ENABLE(WEBXR) 121 class WebXRTest; 122 #endif 123 120 124 template<typename IDLType> class DOMPromiseDeferred; 121 125 … … 1003 1007 bool destroySleepDisabler(unsigned identifier); 1004 1008 1009 #if ENABLE(WEBXR) 1010 ExceptionOr<RefPtr<WebXRTest>> xrTest(); 1011 #endif 1012 1005 1013 private: 1006 1014 explicit Internals(Document&); … … 1027 1035 1028 1036 HashMap<unsigned, std::unique_ptr<WebCore::SleepDisabler>> m_sleepDisablers; 1037 1038 #if ENABLE(WEBXR) 1039 RefPtr<WebXRTest> m_xrTest; 1040 #endif 1029 1041 }; 1030 1042 -
trunk/Source/WebCore/testing/Internals.idl
r260380 r260432 907 907 unsigned long createSleepDisabler(DOMString reason, boolean display); 908 908 boolean destroySleepDisabler(unsigned long identifier); 909 }; 909 910 [Conditional=WEBXR, MayThrowException] readonly attribute WebXRTest xrTest; 911 }; -
trunk/Source/WebCore/testing/WebFakeXRDevice.cpp
r260431 r260432 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "WebFakeXRDevice.h" 27 28 28 29 #if ENABLE(WEBXR) 29 30 30 #include " Supplementable.h"31 #include <wtf/RefPtr.h>31 #include "JSDOMPromiseDeferred.h" 32 #include "WebFakeXRInputController.h" 32 33 33 34 namespace WebCore { 34 35 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 36 void WebFakeXRDevice::setViews(Vector<FakeXRViewInit>) 37 { 38 } 38 39 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 40 void WebFakeXRDevice::disconnect(DOMPromiseDeferred<void>&& promise) 41 { 42 promise.resolve(); 43 } 43 44 44 private: 45 static NavigatorWebXR& from(Navigator&); 45 void WebFakeXRDevice::setViewerOrigin(FakeXRRigidTransformInit origin, bool emulatedPosition) 46 { 47 UNUSED_PARAM(origin); 48 UNUSED_PARAM(emulatedPosition); 49 } 46 50 47 RefPtr<WebXRSystem> m_xr; 48 }; 51 void WebFakeXRDevice::clearViewerOrigin() 52 { 53 } 54 55 void WebFakeXRDevice::simulateVisibilityChange(XRVisibilityState) 56 { 57 } 58 59 void WebFakeXRDevice::setBoundsGeometry(Vector<FakeXRBoundsPoint>) 60 { 61 } 62 63 void WebFakeXRDevice::setFloorOrigin(FakeXRRigidTransformInit) 64 { 65 } 66 67 void WebFakeXRDevice::clearFloorOrigin() 68 { 69 } 70 71 void WebFakeXRDevice::simulateResetPose() 72 { 73 } 74 75 WebFakeXRInputController WebFakeXRDevice::simulateInputSourceConnection(FakeXRInputSourceInit) 76 { 77 return WebFakeXRInputController(); 78 } 49 79 50 80 } // namespace WebCore -
trunk/Source/WebCore/testing/WebFakeXRDevice.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include "FakeXRBoundsPoint.h" 31 #include "FakeXRInputSourceInit.h" 32 #include "FakeXRViewInit.h" 33 #include "JSDOMPromiseDeferred.h" 34 #include "WebFakeXRInputController.h" 35 #include "XRVisibilityState.h" 36 #include <wtf/RefCounted.h> 37 #include <wtf/Vector.h> 32 38 33 39 namespace WebCore { 34 40 35 class Navigator;36 class ScriptExecutionContext; 37 class WebXRSystem;41 class WebFakeXRDevice final : public RefCounted<WebFakeXRDevice> { 42 public: 43 void setViews(Vector<FakeXRViewInit>); 38 44 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 45 void disconnect(DOMPromiseDeferred<void>&&); 43 46 44 private: 45 static NavigatorWebXR& from(Navigator&); 47 void setViewerOrigin(FakeXRRigidTransformInit origin, bool emulatedPosition = false); 46 48 47 RefPtr<WebXRSystem> m_xr; 49 void clearViewerOrigin(); 50 51 void simulateVisibilityChange(XRVisibilityState); 52 53 void setBoundsGeometry(Vector<FakeXRBoundsPoint> boundsCoordinates); 54 55 void setFloorOrigin(FakeXRRigidTransformInit); 56 57 void clearFloorOrigin(); 58 59 void simulateResetPose(); 60 61 WebFakeXRInputController simulateInputSourceConnection(FakeXRInputSourceInit); 48 62 }; 49 63 -
trunk/Source/WebCore/testing/WebFakeXRInputController.cpp
r260431 r260432 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "WebFakeXRInputController.h" 27 28 28 29 #if ENABLE(WEBXR) 29 30 30 #include "Supplementable.h"31 #include <wtf/RefPtr.h>32 33 31 namespace WebCore { 34 32 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 33 void WebFakeXRInputController::setHandedness(XRHandedness) 34 { 35 } 38 36 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 37 void WebFakeXRInputController::setTargetRayMode(XRTargetRayMode) 38 { 39 } 43 40 44 private: 45 static NavigatorWebXR& from(Navigator&); 41 void WebFakeXRInputController::setProfiles(Vector<String>) 42 { 43 } 46 44 47 RefPtr<WebXRSystem> m_xr; 48 }; 45 void WebFakeXRInputController::setGripOrigin(FakeXRRigidTransformInit gripOrigin, bool emulatedPosition) 46 { 47 UNUSED_PARAM(gripOrigin); 48 UNUSED_PARAM(emulatedPosition); 49 } 50 51 void WebFakeXRInputController::clearGripOrigin() 52 { 53 } 54 55 void WebFakeXRInputController::setPointerOrigin(FakeXRRigidTransformInit pointerOrigin, bool emulatedPosition) 56 { 57 UNUSED_PARAM(pointerOrigin); 58 UNUSED_PARAM(emulatedPosition); 59 } 60 61 void WebFakeXRInputController::disconnect() 62 { 63 } 64 65 void WebFakeXRInputController::reconnect() 66 { 67 } 68 69 void WebFakeXRInputController::startSelection() 70 { 71 } 72 73 void WebFakeXRInputController::endSelection() 74 { 75 } 76 77 void WebFakeXRInputController::simulateSelect() 78 { 79 } 80 81 void WebFakeXRInputController::setSupportedButtons(Vector<FakeXRButtonStateInit>) 82 { 83 } 84 85 void WebFakeXRInputController::updateButtonState(FakeXRButtonStateInit) 86 { 87 } 49 88 50 89 } // namespace WebCore -
trunk/Source/WebCore/testing/WebFakeXRInputController.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include "FakeXRButtonStateInit.h" 31 #include "FakeXRRigidTransformInit.h" 32 #include "XRHandedness.h" 33 #include "XRTargetRayMode.h" 34 #include <wtf/RefCounted.h> 35 #include <wtf/Vector.h> 32 36 33 37 namespace WebCore { 34 38 35 class Navigator;36 class ScriptExecutionContext; 37 class WebXRSystem;39 class WebFakeXRInputController final : public RefCounted<WebFakeXRInputController> { 40 public: 41 void setHandedness(XRHandedness); 38 42 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 43 void setTargetRayMode(XRTargetRayMode); 43 44 44 private: 45 static NavigatorWebXR& from(Navigator&); 45 void setProfiles(Vector<String>); 46 46 47 RefPtr<WebXRSystem> m_xr; 47 void setGripOrigin(FakeXRRigidTransformInit gripOrigin, bool emulatedPosition = false); 48 49 void clearGripOrigin(); 50 51 void setPointerOrigin(FakeXRRigidTransformInit pointerOrigin, bool emulatedPosition = false); 52 53 void disconnect(); 54 55 void reconnect(); 56 57 void startSelection(); 58 59 void endSelection(); 60 61 void simulateSelect(); 62 63 void setSupportedButtons(Vector<FakeXRButtonStateInit>); 64 65 void updateButtonState(FakeXRButtonStateInit); 48 66 }; 49 67 -
trunk/Source/WebCore/testing/WebXRTest.cpp
r260431 r260432 24 24 */ 25 25 26 #pragma once 26 #include "config.h" 27 #include "WebXRTest.h" 27 28 28 29 #if ENABLE(WEBXR) 29 30 30 #include "Supplementable.h"31 #include <wtf/RefPtr.h>32 33 31 namespace WebCore { 34 32 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 33 void WebXRTest::simulateDeviceConnection(FakeXRDeviceInit, WebFakeXRDevicePromise&&) const 34 { 35 } 38 36 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 41 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&); 37 void WebXRTest::simulateUserActivation(XRSimulateUserActivationFunction&) 38 { 39 } 43 40 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 48 }; 41 void WebXRTest::disconnectAllDevices(DOMPromiseDeferred<void>&&) 42 { 43 } 49 44 50 45 } // namespace WebCore -
trunk/Source/WebCore/testing/WebXRTest.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "ActiveDOMObject.h"31 #include "EventTarget.h"32 30 #include "JSDOMPromiseDeferred.h" 31 #include "WebFakeXRDevice.h" 33 32 #include "XRSessionMode.h" 34 #include <wtf/IsoMalloc.h> 33 #include "XRSimulateUserActivationFunction.h" 34 #include <JavaScriptCore/JSCJSValue.h> 35 #include <wtf/Optional.h> 35 36 #include <wtf/RefCounted.h> 36 37 37 38 namespace WebCore { 38 39 39 class ScriptExecutionContext; 40 class WebXRSession; 41 struct XRSessionInit; 40 class WebXRSystem; 42 41 43 class WebXRSystem final : public RefCounted<WebXRSystem>, public EventTargetWithInlineData, public ActiveDOMObject { 44 WTF_MAKE_ISO_ALLOCATED(WebXRSystem); 42 class WebXRTest final : public RefCounted<WebXRTest> { 45 43 public: 46 using IsSessionSupportedPromise = DOMPromiseDeferred<IDLBoolean>; 47 using RequestSessionPromise = DOMPromiseDeferred<IDLInterface<WebXRSession>>; 44 struct FakeXRDeviceInit { 45 bool supportsImmersive { false }; 46 Optional<Vector<XRSessionMode>> supportedModes; 47 Vector<FakeXRViewInit> views; 48 48 49 static Ref<WebXRSystem> create(ScriptExecutionContext&); 50 virtual ~WebXRSystem(); 49 Optional<Vector<JSC::JSValue>> supportedFeatures; 51 50 52 using RefCounted<WebXRSystem>::ref; 53 using RefCounted<WebXRSystem>::deref; 51 Optional<Vector<FakeXRBoundsPoint>> boundsCoordinates; 54 52 55 void isSessionSupported(XRSessionMode, IsSessionSupportedPromise&&); 56 void requestSession(XRSessionMode, const XRSessionInit&, RequestSessionPromise&&); 53 Optional<FakeXRRigidTransformInit> floorOrigin; 54 Optional<FakeXRRigidTransformInit> viewerOrigin; 55 }; 56 57 static Ref<WebXRTest> create(WeakPtr<WebXRSystem>&& system) { return adoptRef(*new WebXRTest(WTFMove(system))); } 58 59 using WebFakeXRDevicePromise = DOMPromiseDeferred<IDLInterface<WebFakeXRDevice>>; 60 void simulateDeviceConnection(FakeXRDeviceInit, WebFakeXRDevicePromise&&) const; 61 62 // Simulates a user activation (aka user gesture) for the current scope. 63 // The activation is only guaranteed to be valid in the provided function and only applies to WebXR 64 // Device API methods. 65 void simulateUserActivation(XRSimulateUserActivationFunction&); 66 67 // Disconnect all fake devices 68 void disconnectAllDevices(DOMPromiseDeferred<void>&&); 57 69 58 70 private: 59 WebXRSystem(ScriptExecutionContext&); 71 WebXRTest(WeakPtr<WebXRSystem>&& system) 72 : m_context(WTFMove(system)) { } 60 73 61 // EventTarget 62 EventTargetInterface eventTargetInterface() const override { return WebXRSystemEventTargetInterfaceType; } 63 ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); } 64 void refEventTarget() override { ref(); } 65 void derefEventTarget() override { deref(); } 66 67 // ActiveDOMObject 68 const char* activeDOMObjectName() const override; 69 void stop() override; 74 WeakPtr<WebXRSystem> m_context; 70 75 }; 71 76 -
trunk/Source/WebCore/testing/XRSimulateUserActivationFunction.h
r260431 r260432 28 28 #if ENABLE(WEBXR) 29 29 30 #include "Supplementable.h" 31 #include <wtf/RefPtr.h> 30 #include "ActiveDOMCallback.h" 31 #include "CallbackResult.h" 32 #include <wtf/RefCounted.h> 32 33 33 34 namespace WebCore { 34 35 35 class Navigator; 36 class ScriptExecutionContext; 37 class WebXRSystem; 36 class WebXRFrame; 38 37 39 class NavigatorWebXR final : public Supplement<Navigator> { 40 WTF_MAKE_FAST_ALLOCATED; 38 class XRSimulateUserActivationFunction : public RefCounted<XRSimulateUserActivationFunction>, public ActiveDOMCallback { 41 39 public: 42 static WebXRSystem& xr(ScriptExecutionContext&, Navigator&);40 using ActiveDOMCallback::ActiveDOMCallback; 43 41 44 private: 45 static NavigatorWebXR& from(Navigator&); 46 47 RefPtr<WebXRSystem> m_xr; 42 virtual CallbackResult<void> handleEvent(JSC::JSValue) = 0; 48 43 }; 49 44
Note: See TracChangeset
for help on using the changeset viewer.