| find_library(QUARTZCORE_LIBRARY QuartzCore) | |
| execute_process( | |
| COMMAND xcrun --sdk ${WEBKIT_SDK_NAME} --show-sdk-platform-path | |
| OUTPUT_VARIABLE _platform_dir | |
| OUTPUT_STRIP_TRAILING_WHITESPACE | |
| ) | |
| # Mirror Xcode's "Embed Testing.framework" phase. ditto merges into whatever is already there; | |
| # use a stamp to record a rewrite in case of $_testing_platform_id change | |
| set(_testing_staged) | |
| set(_testing_stamp_dir "${CMAKE_BINARY_DIR}/DerivedSources/TestWebKitAPI") | |
| string(MD5 _testing_platform_id "${_platform_dir}") | |
| foreach (_fw Testing _Testing_AppKit _Testing_CoreGraphics _Testing_CoreImage | |
| _Testing_CoreTransferable _Testing_Foundation _Testing_UIKit) | |
| set(_src "${_platform_dir}/Developer/Library/Frameworks/${_fw}.framework") | |
| set(_dst "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${_fw}.framework") | |
| set(_stamp "${_testing_stamp_dir}/staged-${_fw}-${_testing_platform_id}.stamp") | |
| if (EXISTS "${_src}") | |
| add_custom_command(OUTPUT "${_stamp}" | |
| COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" | |
| COMMAND ${CMAKE_COMMAND} -E make_directory "${_testing_stamp_dir}" | |
| COMMAND ${CMAKE_COMMAND} -E rm -rf "${_dst}" | |
| COMMAND ditto "${_src}" "${_dst}" | |
| COMMAND ${CMAKE_COMMAND} -E touch "${_stamp}" | |
| COMMENT "Staging ${_fw}.framework" | |
| VERBATIM | |
| ) | |
| list(APPEND _testing_staged "${_stamp}") | |
| endif () | |
| endforeach () | |
| set(_src "${_platform_dir}/Developer/usr/lib/lib_TestingInterop.dylib") | |
| set(_dst "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/lib_TestingInterop.dylib") | |
| if (EXISTS "${_src}") | |
| add_custom_command(OUTPUT "${_dst}" | |
| DEPENDS "${_src}" | |
| COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" | |
| COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_src}" "${_dst}" | |
| VERBATIM | |
| ) | |
| list(APPEND _testing_staged "${_dst}") | |
| endif () | |
| add_custom_target(TestWebKitAPIStageTesting DEPENDS ${_testing_staged}) | |
| # WTF feature defines | |
| set(_test_swift_resp "${CMAKE_BINARY_DIR}/DerivedSources/TestWebKitAPI/platform-swift-args.resp") | |
| _webkit_generate_platform_swift_args(TestWebKitAPI "${_test_swift_resp}") | |
| add_custom_target(TestWebKitAPISwiftArgs DEPENDS "${_test_swift_resp}") | |
| # Swift flags for all Test* targets. | |
| _WEBKIT_COMPUTE_SWIFT_SHARED_CLANG_FLAGS(_test_swift_cc_flags) | |
| set(_testwebkitapi_swiftmodule_dir "${CMAKE_CURRENT_BINARY_DIR}/SwiftModules") | |
| set(_testwebkitapi_swift_options | |
| ${WEBKIT_SWIFT_CXX_INTEROP_FLAGS} | |
| "-D ENABLE_CXX_INTEROP" | |
| -no-verify-emitted-module-interface | |
| "@${_test_swift_resp}" | |
| -F${CMAKE_LIBRARY_OUTPUT_DIRECTORY} | |
| "-Xcc -I${CMAKE_BINARY_DIR}" | |
| "-Xcc -I${TESTWEBKITAPI_DIR}" | |
| # wtf/text/CharacterProperties.h includes <unicode/uscript.h>, so the clang importer needs ICU to build the wtf module. | |
| "-Xcc -I${ICU_INCLUDE_DIRS}" | |
| "-I${_testwebkitapi_swiftmodule_dir}" | |
| ) | |
| if (CMAKE_Swift_COMPILER_TARGET) | |
| list(APPEND _testwebkitapi_swift_options "-clang-target ${CMAKE_Swift_COMPILER_TARGET}") | |
| endif () | |
| # @Test and @Suite expand through libTestingMacros, in a `testing` subdirectory | |
| # swiftc does not search on its own. It must come from the default toolchain to | |
| # match the Testing.framework staged above. | |
| WEBKIT_XCRUN(_swift_plugin_server --toolchain XcodeDefault --find swift-plugin-server) | |
| get_filename_component(_swift_toolchain_bin "${_swift_plugin_server}" DIRECTORY) | |
| get_filename_component(_swift_toolchain_usr "${_swift_toolchain_bin}" DIRECTORY) | |
| set(_swift_testing_plugins "${_swift_toolchain_usr}/lib/swift/host/plugins/testing") | |
| if (IS_DIRECTORY "${_swift_testing_plugins}") | |
| # Out of process, as Xcode runs macros: the plugin is not from this compiler's toolchain. | |
| list(APPEND _testwebkitapi_swift_options | |
| "-external-plugin-path ${_swift_testing_plugins}#${_swift_plugin_server}" | |
| ) | |
| endif () | |
| foreach (_f IN LISTS _test_swift_cc_flags) | |
| list(APPEND _testwebkitapi_swift_options "-Xcc ${_f}") | |
| endforeach () | |
| macro(WEBKIT_TEST_ENABLE_SWIFT _target) | |
| target_sources(${_target} PRIVATE | |
| ${TESTWEBKITAPI_DIR}/Runner/TestWebKitAPI.swift | |
| ${TESTWEBKITAPI_DIR}/Runner/TestRunner.swift | |
| ${TESTWEBKITAPI_DIR}/Runner/GoogleTestsController.swift | |
| ${TESTWEBKITAPI_DIR}/Runner/SwiftTestsController.swift | |
| ${TESTWEBKITAPI_DIR}/Runner/SwiftTestingABI.swift | |
| ${TESTWEBKITAPI_DIR}/Runner/TestWebKitAPISupport.mm | |
| ) | |
| get_target_property(_swift_module_name ${_target} OUTPUT_NAME) | |
| if (NOT _swift_module_name) | |
| set(_swift_module_name ${_target}) | |
| endif () | |
| set_target_properties(${_target} PROPERTIES Swift_MODULE_NAME ${_swift_module_name}) | |
| webkit_target_add_swift_options(${_target} | |
| ${_testwebkitapi_swift_options} | |
| "-import-objc-header ${TESTWEBKITAPI_DIR}/Runner/TestWebKitAPI-Bridging-Header.h" | |
| ) | |
| add_dependencies(${_target} TestWebKitAPIStageTesting TestWebKitAPISwiftArgs) | |
| target_link_libraries(${_target} PRIVATE "-F${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" "-framework Testing") | |
| # CMake's Swift executable link ignores CMAKE_EXE_LINKER_FLAGS, so | |
| # -fsanitize=address never reaches the link line. C++ object files get | |
| # instrumented but the ASan runtime isn't linked so it doesn't work. | |
| foreach (_sanitizer IN LISTS ENABLE_SANITIZERS) | |
| target_link_options(${_target} PRIVATE "-sanitize=${_sanitizer}") | |
| endforeach () | |
| endmacro() | |
| set(TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") | |
| # TestWTF | |
| list(APPEND TestWTF_SOURCES | |
| Helpers/cocoa/UtilitiesCocoa.mm | |
| Tests/WTF/cf/RetainPtr.cpp | |
| Tests/WTF/cf/RetainPtrHashing.cpp | |
| Tests/WTF/cf/RetainRef.cpp | |
| Tests/WTF/cf/StringCF.cpp | |
| Tests/WTF/cf/VectorCF.cpp | |
| Tests/WTF/cocoa/BlockPtr.mm | |
| Tests/WTF/cocoa/CStringCocoa.mm | |
| Tests/WTF/cocoa/ContextualizedNSString.mm | |
| Tests/WTF/cocoa/LoggerCocoa.mm | |
| Tests/WTF/cocoa/RetainPtr.mm | |
| Tests/WTF/cocoa/RetainPtrARC.mm | |
| Tests/WTF/cocoa/RetainPtrHashingCocoa.mm | |
| Tests/WTF/cocoa/RetainPtrHashingCocoaARC.mm | |
| Tests/WTF/cocoa/RetainRef.mm | |
| Tests/WTF/cocoa/RetainRefARC.mm | |
| Tests/WTF/cocoa/TextStreamCocoa.cpp | |
| Tests/WTF/cocoa/TextStreamCocoa.mm | |
| Tests/WTF/cocoa/TypeCastsCocoa.mm | |
| Tests/WTF/cocoa/TypeCastsCocoaARC.mm | |
| Tests/WTF/cocoa/UUIDCocoa.mm | |
| Tests/WTF/cocoa/VectorCocoa.mm | |
| Tests/WTF/darwin/MachSendRight.cpp | |
| Tests/WTF/darwin/OSObjectPtr.cpp | |
| Tests/WTF/darwin/OSObjectPtrCocoa.mm | |
| Tests/WTF/darwin/OSObjectPtrCocoaARC.mm | |
| Tests/WTF/darwin/TypeCastsOSObjectCF.cpp | |
| Tests/WTF/darwin/TypeCastsOSObjectCocoa.mm | |
| Tests/WTF/darwin/TypeCastsOSObjectCocoaARC.mm | |
| Tests/WTF/darwin/WeakLinking.cpp | |
| ) | |
| # The shared prefix header is precompiled without ARC, so these can't reuse it. | |
| set_source_files_properties( | |
| Tests/WTF/cocoa/RetainPtrARC.mm | |
| Tests/WTF/cocoa/RetainPtrHashingCocoaARC.mm | |
| Tests/WTF/cocoa/RetainRefARC.mm | |
| Tests/WTF/cocoa/TypeCastsCocoaARC.mm | |
| Tests/WTF/darwin/OSObjectPtrCocoaARC.mm | |
| Tests/WTF/darwin/TypeCastsOSObjectCocoaARC.mm | |
| PROPERTIES | |
| COMPILE_FLAGS "-fobjc-arc -include ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/TestWebKitAPIPrefix.h" | |
| SKIP_PRECOMPILE_HEADERS ON) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWTF_SOURCES Tests/WTF/bmalloc/MAR.cpp) | |
| list(APPEND TestWTF_LIBRARIES "-framework Carbon" "-framework Cocoa") | |
| endif () | |
| list(APPEND TestWTF_LIBRARIES | |
| "-framework CoreFoundation" | |
| ) | |
| # Tests/WTF/{cf,cocoa,darwin} include headers from Tests/WTF by name. | |
| list(APPEND TestWTF_PRIVATE_INCLUDE_DIRECTORIES | |
| ${TESTWEBKITAPI_DIR}/Tests/WTF | |
| ) | |
| # Includes handwritten .tbd stubs needed by WeakLinking.cpp. | |
| list(APPEND TestWTF_LIBRARIES | |
| -L${TESTWEBKITAPI_DIR}/Tests/WTF/darwin | |
| ) | |
| # TestJavaScriptCore | |
| list(APPEND TestJavaScriptCore_SOURCES | |
| Tests/JavaScriptCore/JSRunLoopTimer.mm | |
| ) | |
| # TestWebCore | |
| list(APPEND TestWebCore_SOURCES | |
| Helpers/cocoa/TestNSBundleExtras.m | |
| Helpers/cocoa/UtilitiesCocoa.mm | |
| Tests/WebCore/ContentExtensions.cpp | |
| Tests/WebCore/HysteresisActivityTests.cpp | |
| Tests/WebCore/ISOBox.cpp | |
| Tests/WebCore/Logging.cpp | |
| Tests/WebCore/MarkedText.cpp | |
| Tests/WebCore/PlatformCAAnimationKeyPath.cpp | |
| Tests/WebCore/StringUtilities.mm | |
| Tests/WebCore/TextBoundaries.cpp | |
| Tests/WebCore/UserAgentStringParser.cpp | |
| Tests/WebCore/YouTubePluginReplacement.cpp | |
| Tests/WebCore/cocoa/AVFoundationSoftLinkTest.mm | |
| Tests/WebCore/cocoa/AttributedStringFontCache.mm | |
| Tests/WebCore/cocoa/AudioStreamDescriptionCocoa.mm | |
| Tests/WebCore/cocoa/AudioVideoRendererAVFObjCTests.mm | |
| Tests/WebCore/cocoa/BifurcatedGraphicsContextTestsCG.cpp | |
| Tests/WebCore/cocoa/CaptionPreferencesTests.mm | |
| Tests/WebCore/cocoa/CoreMediaUtilities.mm | |
| Tests/WebCore/cocoa/DatabaseTrackerTest.mm | |
| Tests/WebCore/cocoa/DecodedMediaSamplesBlockTests.mm | |
| Tests/WebCore/cocoa/GraphicsContextCGTests.mm | |
| Tests/WebCore/cocoa/H264UtilitiesCocoaTests.mm | |
| Tests/WebCore/cocoa/HEVCUtilitiesCocoaTests.mm | |
| Tests/WebCore/cocoa/IOSurfacePoolTests.cpp | |
| Tests/WebCore/cocoa/IOSurfaceTests.mm | |
| Tests/WebCore/cocoa/ImageRotationSessionVT.cpp | |
| Tests/WebCore/cocoa/MediaPlayerPrivateAVFoundationObjCTests.mm | |
| Tests/WebCore/cocoa/MediaRecorderPrivateWriterTests.cpp | |
| Tests/WebCore/cocoa/MediaSamplesDecoderTests.mm | |
| Tests/WebCore/cocoa/PaymentSummaryItemsCocoa.mm | |
| Tests/WebCore/cocoa/PrivateClickMeasurementCocoa.mm | |
| Tests/WebCore/cocoa/ResourceMonitor.mm | |
| Tests/WebCore/cocoa/ScrollbarWidthCrash.mm | |
| Tests/WebCore/cocoa/SerializedCryptoKeyWrap.mm | |
| Tests/WebCore/cocoa/ShareableSpatialImageTests.mm | |
| Tests/WebCore/cocoa/SharedBuffer.mm | |
| Tests/WebCore/cocoa/SharedVideoFrame.mm | |
| Tests/WebCore/cocoa/TestGraphicsContextGLCocoa.mm | |
| Tests/WebCore/cocoa/TestUTIRegistry.cpp | |
| Tests/WebCore/cocoa/TestUTIUtilities.cpp | |
| Tests/WebCore/cocoa/WebCoreDecompressionSessionTests.mm | |
| Tests/WebCore/cocoa/WebCoreNSURLSession.mm | |
| Tests/WebCore/cocoa/XMLParsing.mm | |
| ) | |
| list(APPEND TestWebCore_LIBRARIES | |
| ${QUARTZCORE_LIBRARY} | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebCore_LIBRARIES "-framework Cocoa") | |
| endif () | |
| # TestWebKitLegacy | |
| list(APPEND TestWebKitLegacy_SOURCES | |
| Helpers/cocoa/TestNSBundleExtras.m | |
| Tests/WebKitLegacy/cocoa/SubstituteDataLocalResourceAccess.mm | |
| Tests/WebKitLegacy/cocoa/WebPreferencesTest.mm | |
| ) | |
| list(APPEND TestWebKitLegacy_LIBRARIES | |
| WebKit | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebKitLegacy_SOURCES | |
| Tests/WebKitLegacy/mac/AccessingPastedImage.mm | |
| Tests/WebKitLegacy/mac/ClosingWebView.mm | |
| Tests/WebKitLegacy/mac/CustomProtocolsInvalidScheme.mm | |
| Tests/WebKitLegacy/mac/CustomProtocolsTest.mm | |
| Tests/WebKitLegacy/mac/DeallocWebViewInEventListener.mm | |
| Tests/WebKitLegacy/mac/DeallocWebViewProviders.mm | |
| Tests/WebKitLegacy/mac/DownloadThread.mm | |
| Tests/WebKitLegacy/mac/EarlyKVOCrash.mm | |
| Tests/WebKitLegacy/mac/EmbeddedPrintPagination.mm | |
| Tests/WebKitLegacy/mac/PDFEmbeddedPrintScript.mm | |
| Tests/WebKitLegacy/mac/PreventImageLoadWithAutoResizing.mm | |
| Tests/WebKitLegacy/mac/URLExtras.mm | |
| Tests/WebKitLegacy/mac/UserContentTest.mm | |
| Tests/WebKitLegacy/mac/WKBrowsingContextLoadDelegateTest.mm | |
| ) | |
| list(APPEND TestWebKitLegacy_LIBRARIES "-framework Carbon" "-framework Cocoa") | |
| else () | |
| list(APPEND TestWebKitLegacy_SOURCES | |
| Tests/WebKitLegacy/ios/AudioSessionCategoryIOS.mm | |
| Tests/WebKitLegacy/ios/DateTimeInputsAccessoryViewTests.mm | |
| Tests/WebKitLegacy/ios/JSLockTakesWebThreadLock.mm | |
| Tests/WebKitLegacy/ios/PreemptVideoFullscreen.mm | |
| Tests/WebKitLegacy/ios/ScrollToRevealSelection.mm | |
| Tests/WebKitLegacy/ios/ScrollingDoesNotPauseMedia.mm | |
| Tests/WebKitLegacy/ios/SnapshotViaRenderInContext.mm | |
| Tests/WebKitLegacy/ios/WebGLNoCrashOnOtherThreadAccess.mm | |
| Tests/WebKitLegacy/ios/WebGLPrepareDisplayOnWebThread.mm | |
| Tests/WebKitLegacy/ios/WebThreadLock.mm | |
| ) | |
| endif () | |
| # TestWebKit | |
| set(TestWebKit_DERIVED_SOURCES_DIR "${CMAKE_BINARY_DIR}/DerivedSources/TestWebKit") | |
| list(APPEND TestWebKit_UNIFIED_SOURCE_LIST_FILES | |
| "SourcesCocoa.txt" | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebKit_UNIFIED_SOURCE_LIST_FILES "SourcesMac.txt") | |
| endif () | |
| # Files compiled outside unified sources (Xcode membershipExceptions). | |
| list(APPEND TestWebKit_SOURCES | |
| Helpers/Counters.cpp | |
| Helpers/DeprecatedGlobalValues.cpp | |
| Helpers/GraphicsTestUtilities.cpp | |
| Helpers/TestNotificationProvider.cpp | |
| Helpers/WebCoreTestUtilities.cpp | |
| Helpers/cocoa/HTTPServer.mm | |
| Helpers/cocoa/MiniTURNServer.mm | |
| Helpers/cocoa/TestCocoaImageAndCocoaColor.mm | |
| Helpers/cocoa/TestElementFullscreenDelegate.mm | |
| Helpers/cocoa/TestNSBundleExtras.m | |
| Helpers/cocoa/UtilitiesCocoa.mm | |
| Helpers/cocoa/WebExtensionUtilities.mm | |
| Helpers/cocoa/WebTransportServer.mm | |
| Helpers/mac/GamepadMappings/GoogleStadia.mm | |
| Helpers/mac/GamepadMappings/LogitechF310.mm | |
| Helpers/mac/GamepadMappings/LogitechF710.mm | |
| Helpers/mac/GamepadMappings/MicrosoftXboxOne.mm | |
| Helpers/mac/GamepadMappings/ShenzhenLongshengweiTechnologyGamepad.mm | |
| Helpers/mac/GamepadMappings/SonyDualShock3.mm | |
| Helpers/mac/GamepadMappings/SonyDualShock4.mm | |
| Helpers/mac/GamepadMappings/SteelSeriesNimbus.mm | |
| Helpers/mac/GamepadMappings/SunLightApplicationGenericNES.mm | |
| Tests/TestWebKitAPIAdditionsHook.mm | |
| Tests/Misc/TestRunnerTests.cpp | |
| Tests/WebCore/ASN1Utilities.cpp | |
| Tests/WebCore/CachedMatchFinder.cpp | |
| Tests/WebCore/TestPlatformStrategies.cpp | |
| Tests/WebCore/cocoa/ISOBMFFTrackInfoParserTests.cpp | |
| Tests/WebCore/cocoa/PlatformScreenTests.mm | |
| Tests/WebKit/DeviceIdHashSaltStorage.cpp | |
| Tests/WebKit/WKPage/DidRemoveFrameFromHiearchyInPageCache.cpp | |
| Tests/WebKit/WKPage/EnvironmentUtilitiesTest.cpp | |
| Tests/WebKit/WKPage/MenuTypesForMouseEvents.cpp | |
| Tests/WebKit/WKPage/ModalAlertsSPI.cpp | |
| Tests/WebKit/WKPage/NavigationClientDefaultCrypto.cpp | |
| Tests/WebKit/WKPage/RestoreSessionState.cpp | |
| Tests/WebKit/WKPage/ShouldKeepCurrentBackForwardListItemInList.cpp | |
| Tests/WebKit/WKPage/WKImageCreateCGImageCrash.cpp | |
| Tests/WebKit/WKPage/WKPageIsPlayingAudio.cpp | |
| Tests/WebKit/WKPage/WebArchive.cpp | |
| Tests/WebKit/WKPage/cocoa/AccessibilityIncreaseContrast.mm | |
| Tests/WebKit/WKPage/cocoa/AccessibilityReduceMotion.mm | |
| Tests/WebKit/WKPage/cocoa/AccessibilityRemoteUIApp.mm | |
| Tests/WebKit/WKPage/cocoa/AttributedSubstringForProposedRangeCAPI.mm | |
| Tests/WebKit/WKPage/cocoa/Battery.mm | |
| Tests/WebKit/WKPage/cocoa/ContextMenuDownload.mm | |
| Tests/WebKit/WKPage/cocoa/ContextMenuImgWithVideo.mm | |
| Tests/WebKit/WKPage/cocoa/CustomBundleObject.mm | |
| Tests/WebKit/WKPage/cocoa/CustomBundleParameter.mm | |
| Tests/WebKit/WKPage/cocoa/EditorCommands.mm | |
| Tests/WebKit/WKPage/cocoa/EnableAccessibility.mm | |
| Tests/WebKit/WKPage/cocoa/FetchLocalFile.mm | |
| Tests/WebKit/WKPage/cocoa/FindMatches.mm | |
| Tests/WebKit/WKPage/cocoa/FontRegistrySandboxCheck.mm | |
| Tests/WebKit/WKPage/cocoa/ForceLightAppearanceInBundle.mm | |
| Tests/WebKit/WKPage/cocoa/GetBackingScaleFactor.mm | |
| Tests/WebKit/WKPage/cocoa/GetPIDAfterAbortedProcessLaunch.cpp | |
| Tests/WebKit/WKPage/cocoa/InjectedBundleAppleEvent.cpp | |
| Tests/WebKit/WKPage/cocoa/LocalizedDeviceModel.mm | |
| Tests/WebKit/WKPage/cocoa/LogForwarding.mm | |
| Tests/WebKit/WKPage/cocoa/MediaSessionCoordinatorTest.mm | |
| Tests/WebKit/WKPage/cocoa/MobileAssetSandboxCheck.mm | |
| Tests/WebKit/WKPage/cocoa/NetworkProcessCrashWithPendingConnection.mm | |
| Tests/WebKit/WKPage/cocoa/OverrideAppleLanguagesPreference.mm | |
| Tests/WebKit/WKPage/cocoa/PasteboardNotifications.mm | |
| Tests/WebKit/WKPage/cocoa/PictureInPictureSupport.mm | |
| Tests/WebKit/WKPage/cocoa/PreferenceChanges.mm | |
| Tests/WebKit/WKPage/cocoa/ResponsivenessTimerCrash.mm | |
| Tests/WebKit/WKPage/cocoa/RestoreStateAfterTermination.mm | |
| Tests/WebKit/WKPage/cocoa/ScrollPinningBehaviors.mm | |
| Tests/WebKit/WKPage/cocoa/SleepDisabler.mm | |
| Tests/WebKit/WKPage/cocoa/SyscallUnixSandboxCheck.mm | |
| Tests/WebKit/WKPage/cocoa/SystemBeep.mm | |
| Tests/WebKit/WKPage/cocoa/WeakObjCPtr.mm | |
| Tests/WebKit/WKPage/cocoa/WebFilter.mm | |
| Tests/WebKit/WKPage/cocoa/XPCEndpoint.mm | |
| Tests/WebKit/WKWebView/AnimationControl.mm | |
| Tests/WebKit/WKWebView/FullscreenLifecycle.mm | |
| Tests/WebKit/WKWebView/GetUserMediaNavigation.mm | |
| Tests/WebKit/WKWebView/InjectedBundleHitTest.mm | |
| Tests/WebKit/WKWebView/InstanceMethodSwizzler.mm | |
| Tests/WebKit/WKWebView/MSEIsTypeSupportedCaching.mm | |
| Tests/WebKit/WKWebView/MediaStreamTrackDetached.mm | |
| Tests/WebKit/WKWebView/MediaStreamingActivitySuspended.mm | |
| Tests/WebKit/WKWebView/NoHistoryItemScrollToFragment.mm | |
| Tests/WebKit/WKWebView/NowPlayingMetadataObserver.mm | |
| Tests/WebKit/WKWebView/OrthogonalFlowAvailableSize.mm | |
| Tests/WebKit/WKWebView/ParentalControlsContentFilteringTests.mm | |
| Tests/WebKit/WKWebView/SmartLists.mm | |
| Tests/WebKit/WKWebView/SpatialAudioExperience.mm | |
| Tests/WebKit/WKWebView/WKBackForwardListTests.mm | |
| Tests/WebKit/WKWebView/WKWebExtensionAPILocalization.mm | |
| Tests/WebKit/WKWebView/WKWebViewLogging.mm | |
| Tests/WebKit/WKWebView/WKWebViewSpatialTrackingLabels.mm | |
| Tests/WebKit/WKWebView/WebRTC.mm | |
| Tests/WebKit/WKWebView/ios/FullscreenTouchSecheuristicTests.cpp | |
| Tests/WebKit/WebPage/EnhancedSecurityTests.swift | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebKit_SOURCES | |
| ${TOOLS_DIR}/TestRunnerShared/mac/SyntheticNSEvent.mm | |
| Helpers/mac/DragAndDropSimulatorMac.mm | |
| Helpers/mac/JavaScriptTestMac.mm | |
| Helpers/mac/NSFontPanelTesting.mm | |
| Helpers/mac/OffscreenWindow.mm | |
| Helpers/mac/PlatformUtilitiesMac.mm | |
| Helpers/mac/PlatformWebViewMac.mm | |
| Helpers/mac/SyntheticBackingScaleFactorWindow.m | |
| Helpers/mac/TestBrowsingContextLoadDelegate.mm | |
| Helpers/mac/TestDraggingInfo.mm | |
| Helpers/mac/TestFilePromiseReceiver.mm | |
| Helpers/mac/TestFontOptions.mm | |
| Helpers/mac/TestInspectorBar.mm | |
| Helpers/mac/VirtualGamepad.mm | |
| Helpers/mac/WKWebViewForTestingImmediateActions.mm | |
| Helpers/mac/WebKitAgnosticTest.mm | |
| Tests/WebKit/WKPage/mac/CustomProtocolsSyncXHRTest.mm | |
| Tests/WebKit/WKPage/mac/DeferredViewInWindowStateChange.mm | |
| Tests/WebKit/WKPage/mac/WKThumbnailView.mm | |
| Tests/WebKit/WKWebView/AdvancedPrivacyProtections.mm | |
| Tests/WebKit/WKWebView/AllowInlinePlaybackInDesktopClassBrowsing.mm | |
| Tests/WebKit/WKWebView/DictationStreamingOpacity.mm | |
| Tests/WebKit/WKWebView/GetUserMediaReprompt.mm | |
| Tests/WebKit/WKWebView/NowPlayingSession.mm | |
| Tests/WebKit/WKWebView/mac/AttributedSubstringForProposedRange.mm | |
| Tests/WebKit/WKWebView/mac/GrammarMarkerPrecedence.mm | |
| Tests/WebKit/WKWebView/mac/NSRefreshControllerTests.mm | |
| Tests/WebKit/WKWebView/mac/PasteboardFileTypeBlocklist.mm | |
| Tests/WebKit/WKWebView/mac/RunningBoardManagement.mm | |
| Tests/WebKit/WKWebView/mac/WordBoundaryTypingAttributes.mm | |
| ) | |
| else () | |
| list(APPEND TestWebKit_SOURCES | |
| Helpers/cocoa/TestContextMenuDriver.mm | |
| Helpers/ios/DragAndDropSimulatorIOS.mm | |
| Helpers/ios/PreferredContentMode.mm | |
| Helpers/ios/TestUIMenuBuilder.mm | |
| Helpers/ios/TestWKWebViewController.mm | |
| Helpers/ios/UIKitTestingHelpers.mm | |
| Tests/WebCore/cocoa/PaymentSummaryItemsCocoa.mm | |
| Tests/WebCore/ios/PreviewConverter.cpp | |
| Tests/WebKit/WKWebView/GetUserMedia.mm | |
| Tests/WebKit/WKWebView/MediaLoading.mm | |
| Tests/WebKit/WKWebView/WKAttachmentTests.mm | |
| Tests/WebKit/WKWebView/ios/AccessibilityTestsIOS.mm | |
| Tests/WebKit/WKWebView/ios/ActionSheetTests.mm | |
| Tests/WebKit/WKWebView/ios/ApplicationStateTracking.mm | |
| Tests/WebKit/WKWebView/ios/AutocorrectionTestsIOS.mm | |
| Tests/WebKit/WKWebView/ios/BacklightLevelNotification.mm | |
| Tests/WebKit/WKWebView/ios/CALayerTreeAsText.mm | |
| Tests/WebKit/WKWebView/ios/CustomContentViewGestures.mm | |
| Tests/WebKit/WKWebView/ios/DataDetectorsTestIOS.mm | |
| Tests/WebKit/WKWebView/ios/DataListTextSuggestionTests.mm | |
| Tests/WebKit/WKWebView/ios/DragAndDropTestsIOS.mm | |
| Tests/WebKit/WKWebView/ios/ElementActionTests.mm | |
| Tests/WebKit/WKWebView/ios/EnterKeyHintTests.mm | |
| Tests/WebKit/WKWebView/ios/FocusPreservationTests.mm | |
| Tests/WebKit/WKWebView/ios/FullscreenLayoutParameters.mm | |
| Tests/WebKit/WKWebView/ios/GestureRecognizerTests.mm | |
| Tests/WebKit/WKWebView/ios/GrantAccessToMobileAssets.mm | |
| Tests/WebKit/WKWebView/ios/InteractiveWidget.mm | |
| Tests/WebKit/WKWebView/ios/KeyboardInputTestsIOS.mm | |
| Tests/WebKit/WKWebView/ios/ModalDialogDuringOverlappingFocus.mm | |
| Tests/WebKit/WKWebView/ios/OverflowScrollViewTests.mm | |
| Tests/WebKit/WKWebView/ios/RenderingProgressTests.mm | |
| Tests/WebKit/WKWebView/ios/ScrollViewBouncesTests.mm | |
| Tests/WebKit/WKWebView/ios/ScrollViewInsetTests.mm | |
| Tests/WebKit/WKWebView/ios/ScrollViewScrollabilityTests.mm | |
| Tests/WebKit/WKWebView/ios/SelectionByWord.mm | |
| Tests/WebKit/WKWebView/ios/SelectionModifyByParagraphBoundary.mm | |
| Tests/WebKit/WKWebView/ios/SetTimeoutFunction.mm | |
| Tests/WebKit/WKWebView/ios/ShareSheetTests.mm | |
| Tests/WebKit/WKWebView/ios/SynchronousTimeoutTests.mm | |
| Tests/WebKit/WKWebView/ios/TestInputDelegate.mm | |
| Tests/WebKit/WKWebView/ios/TextAlternatives.mm | |
| Tests/WebKit/WKWebView/ios/TextAutosizingBoost.mm | |
| Tests/WebKit/WKWebView/ios/TextServicesTests.mm | |
| Tests/WebKit/WKWebView/ios/TextStyleFontSize.mm | |
| Tests/WebKit/WKWebView/ios/TouchEventTests.mm | |
| Tests/WebKit/WKWebView/ios/UIFocusTests.mm | |
| Tests/WebKit/WKWebView/ios/UIPasteboardTests.mm | |
| Tests/WebKit/WKWebView/ios/UIViewTreeAsText.mm | |
| Tests/WebKit/WKWebView/ios/UIWKInteractionViewProtocol.mm | |
| Tests/WebKit/WKWebView/ios/UserInterfaceIdiomUpdate.mm | |
| Tests/WebKit/WKWebView/ios/Viewport.mm | |
| Tests/WebKit/WKWebView/ios/VisualViewport.mm | |
| Tests/WebKit/WKWebView/ios/WKScrollViewTests.mm | |
| Tests/WebKit/WKWebView/ios/WKWebViewAutofillTests.mm | |
| Tests/WebKit/WKWebView/ios/WKWebViewOpaque.mm | |
| Tests/WebKit/WKWebView/ios/WKWebViewPausePlayingAudioTests.mm | |
| Tests/WebKit/WKWebView/ios/WindowOrientation.mm | |
| Tests/WebKit/WKWebView/ios/ZoomToFocusedElement.mm | |
| ) | |
| endif () | |
| list(APPEND TestWebKit_PRIVATE_INCLUDE_DIRECTORIES | |
| ${ICU_INCLUDE_DIRS} | |
| ${WTF_FRAMEWORK_HEADERS_DIR} | |
| ${bmalloc_FRAMEWORK_HEADERS_DIR} | |
| ${WebKit_FRAMEWORK_HEADERS_DIR} | |
| ${WebKitLegacy_FRAMEWORK_HEADERS_DIR} | |
| ${TOOLS_DIR}/TestRunnerShared/cocoa | |
| ${TOOLS_DIR}/TestRunnerShared/mac | |
| ${TOOLS_DIR}/TestRunnerShared/spi | |
| ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR}/WebCoreTestSupport | |
| ${TESTWEBKITAPI_DIR}/Helpers | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa | |
| ${TESTWEBKITAPI_DIR}/Helpers/mac | |
| ${TESTWEBKITAPI_DIR}/Tests/WebCore | |
| ${TESTWEBKITAPI_DIR}/Tests/WebCore/cocoa | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ios | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/mac | |
| ${CMAKE_SOURCE_DIR}/Source/ThirdParty/libwebrtc/Source | |
| ${CMAKE_SOURCE_DIR}/Source/ThirdParty/libwebrtc/Source/webrtc | |
| ${CMAKE_SOURCE_DIR}/Source/ThirdParty/libwebrtc/Source/third_party/abseil-cpp | |
| ${WEBKIT_DIR}/Platform/spi/Cocoa | |
| ${WEBKIT_DIR}/Platform/IPC | |
| ${WEBKIT_DIR}/Platform/IPC/cocoa | |
| ${WEBKIT_DIR}/Shared | |
| ${WEBKIT_DIR}/Shared/Cocoa | |
| ${WEBKIT_DIR}/UIProcess | |
| ${WebKit_DERIVED_SOURCES_DIR} | |
| ${WebKit_DERIVED_SOURCES_DIR}/IPC | |
| ${WEBKIT_DIR}/Platform/cocoa | |
| ) | |
| if (NOT WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebKit_PRIVATE_INCLUDE_DIRECTORIES | |
| ${TESTWEBKITAPI_DIR}/Helpers/ios | |
| ${TESTWEBKITAPI_DIR}/Tests/WebCore/ios | |
| ${WEBKIT_DIR}/Platform/spi/ios | |
| ${WEBKIT_DIR}/Shared/ios | |
| ${WEBKIT_DIR}/UIProcess/ios | |
| ) | |
| endif () | |
| list(APPEND TestWebKit_LIBRARIES | |
| "-framework AuthKit" | |
| "-framework LocalAuthentication" | |
| "-framework Network" | |
| "-framework QuartzCore" | |
| "-framework UniformTypeIdentifiers" | |
| JavaScriptCore | |
| WebCoreTestSupport | |
| WebKitLegacy | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWebKit_LIBRARIES | |
| "-framework AuthenticationServices" | |
| "-framework Carbon" | |
| "-framework Cocoa" | |
| "-framework HID" | |
| "-framework Reveal" | |
| ) | |
| else () | |
| list(APPEND TestWebKit_LIBRARIES | |
| "-framework AVKit" | |
| "-framework BrowserEngineKit" | |
| "-framework GameController" | |
| "-framework MobileCoreServices" | |
| "-framework PDFKit" | |
| "-framework UIKit" | |
| ) | |
| target_link_options(TestWebKit PRIVATE "LINKER:-delay_framework,CoreTelephony") | |
| endif () | |
| target_link_options(TestWebKit PRIVATE | |
| "LINKER:-weak_framework,WritingTools" | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| target_link_options(TestWebKit PRIVATE "LINKER:-weak_framework,WritingToolsUI") | |
| endif () | |
| set_source_files_properties( | |
| Helpers/cocoa/WebExtensionUtilities.mm | |
| Tests/WebKit/WKWebView/WKWebExtensionAPILocalization.mm | |
| PROPERTIES | |
| COMPILE_FLAGS "-fobjc-arc -include ${CMAKE_CURRENT_SOURCE_DIR}/Helpers/TestWebKitAPIPrefix.h" | |
| SKIP_PRECOMPILE_HEADERS ON) | |
| set_source_files_properties( | |
| Helpers/cocoa/TestNSBundleExtras.m | |
| Helpers/mac/SyntheticBackingScaleFactorWindow.m | |
| PROPERTIES SKIP_PRECOMPILE_HEADERS ON) | |
| # NSWindow.autodisplay is deprecated since 10.14 but still used in OffscreenWindow.mm. | |
| WEBKIT_ADD_TARGET_CXX_FLAGS(TestWebKit -Wno-deprecated-declarations) | |
| # run-api-tests expects the binary to be named TestWebKitAPI. | |
| set_target_properties(TestWebKit PROPERTIES OUTPUT_NAME TestWebKitAPI) | |
| # Embed the Info.plist in the __TEXT,__info_plist section. PRODUCT_NAME and | |
| # PRODUCT_BUNDLE_IDENTIFIER only exist for the configure_file substitution. | |
| set(PRODUCT_NAME TestWebKitAPI) | |
| set(PRODUCT_BUNDLE_IDENTIFIER com.apple.WebKit.TestWebKitAPI) | |
| configure_file("${TESTWEBKITAPI_DIR}/Info.plist" | |
| "${CMAKE_CURRENT_BINARY_DIR}/TestWebKitAPI-Info.plist") | |
| unset(PRODUCT_NAME) | |
| unset(PRODUCT_BUNDLE_IDENTIFIER) | |
| target_link_options(TestWebKit PRIVATE | |
| "LINKER:-sectcreate,__TEXT,__info_plist,${CMAKE_CURRENT_BINARY_DIR}/TestWebKitAPI-Info.plist") | |
| set_property(TARGET TestWebKit APPEND PROPERTY LINK_DEPENDS | |
| "${CMAKE_CURRENT_BINARY_DIR}/TestWebKitAPI-Info.plist") | |
| if (WEBKIT_SDK_IS_SIMULATOR) | |
| # As in Xcode, simulator binaries carry their entitlements in | |
| # __TEXT,__entitlements. Passing OUTPUT leaves CODE_SIGN_ENTITLEMENTS | |
| # unset, so they're signed with the default get-task-allow entitlements. | |
| foreach (_test_target IN ITEMS TestWTF TestWebKit TestIPC TestWGSL) | |
| if (TARGET ${_test_target}) | |
| webkit_generate_entitlements(${_test_target} | |
| USING ${TESTWEBKITAPI_DIR}/Scripts/process-entitlements.sh | |
| BUNDLE_IDENTIFIER com.apple.WebKit.TestWebKitAPI | |
| OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_test_target}.entitlements) | |
| WEBKIT_EMBED_ENTITLEMENTS(${_test_target} ${CMAKE_CURRENT_BINARY_DIR}/${_test_target}.entitlements) | |
| endif () | |
| endforeach () | |
| else () | |
| webkit_generate_entitlements(TestWebKit | |
| USING ${TESTWEBKITAPI_DIR}/Scripts/process-entitlements.sh | |
| BUNDLE_IDENTIFIER com.apple.WebKit.TestWebKitAPI) | |
| endif () | |
| # TestWGSL | |
| if (ENABLE_WEBGPU) | |
| list(APPEND TestWGSL_SOURCES | |
| Tests/WGSL/MetalCompilationTests.mm | |
| Tests/WGSL/TypeCheckingTests.mm | |
| ) | |
| list(APPEND TestWGSL_PRIVATE_INCLUDE_DIRECTORIES | |
| ${WTF_FRAMEWORK_HEADERS_DIR} | |
| ${bmalloc_FRAMEWORK_HEADERS_DIR} | |
| ) | |
| list(APPEND TestWGSL_LIBRARIES "-framework Metal") | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestWGSL_LIBRARIES "-framework Carbon") | |
| endif () | |
| # Resources used by MetalCompilationTests and TypeCheckingTests. | |
| # FIXME: Globbing is hazardous for incremental builds, tracking a | |
| # workaround in rdar://188725492. | |
| file(GLOB TestWGSL_SHADERS "${TESTWEBKITAPI_DIR}/Tests/WGSL/shaders/*.wgsl") | |
| add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/copied-wgsl-shaders.stamp" | |
| COMMAND ${CMAKE_COMMAND} -E copy_directory | |
| "${TESTWEBKITAPI_DIR}/Tests/WGSL/shaders" | |
| "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/shaders" | |
| COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/copied-wgsl-shaders.stamp" | |
| DEPENDS ${TestWGSL_SHADERS} | |
| COMMENT "Copying WGSL test shaders") | |
| set_property(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} PROPERTY | |
| ADDITIONAL_CLEAN_FILES "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/shaders") | |
| add_custom_target(TestWGSLShaders | |
| DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/copied-wgsl-shaders.stamp") | |
| add_dependencies(TestWGSL TestWGSLShaders) | |
| endif () | |
| # Common framework header directories needed by config.h (<wtf/Platform.h>, <WebKit/WebKit2_C.h>, etc.) | |
| set(_testapi_framework_headers | |
| ${WTF_FRAMEWORK_HEADERS_DIR} | |
| ${bmalloc_FRAMEWORK_HEADERS_DIR} | |
| ${PAL_FRAMEWORK_HEADERS_DIR} | |
| ) | |
| if (NOT USE_FRAMEWORK_BUNDLES) | |
| list(APPEND _testapi_framework_headers | |
| ${JavaScriptCore_FRAMEWORK_HEADERS_DIR} | |
| ${JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS_DIR} | |
| ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR} | |
| ${WebKit_FRAMEWORK_HEADERS_DIR} | |
| ${WebKitLegacy_FRAMEWORK_HEADERS_DIR} | |
| ) | |
| endif () | |
| foreach (_dir IN LISTS _testapi_framework_headers) | |
| list(APPEND _testwebkitapi_swift_options "-Xcc -I${_dir}") | |
| endforeach () | |
| macro(WEBKIT_TEST_SWIFT_HELPER_LIBRARY _library _test_target) | |
| set_target_properties(${_library} PROPERTIES | |
| Swift_MODULE_NAME ${_library} | |
| Swift_MODULE_DIRECTORY ${_testwebkitapi_swiftmodule_dir} | |
| ) | |
| webkit_target_add_swift_options(${_library} ${_testwebkitapi_swift_options}) | |
| target_include_directories(${_library} PRIVATE | |
| ${CMAKE_BINARY_DIR} | |
| ${TESTWEBKITAPI_DIR} | |
| ${_testapi_framework_headers} | |
| ) | |
| # config.h includes <gtest/gtest.h>. | |
| target_link_libraries(${_library} PRIVATE WebKit::gtest) | |
| add_dependencies(${_library} TestWebKitAPIStageTesting TestWebKitAPISwiftArgs) | |
| target_link_libraries(${_test_target} PRIVATE ${_library}) | |
| endmacro() | |
| add_library(TestWTFLibrary OBJECT | |
| ${TESTWEBKITAPI_DIR}/TestWTFLibrary/SwiftCxxInteropTestbed.cpp | |
| ${TESTWEBKITAPI_DIR}/TestWTFLibrary/TestWTFLibrary.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/WTFCompletionHandler+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/WTFExpected+Extras.swift | |
| ) | |
| WEBKIT_TEST_SWIFT_HELPER_LIBRARY(TestWTFLibrary TestWTF) | |
| list(APPEND TestWTF_SOURCES | |
| Tests/WTF/cocoa/SwiftCxxInteropTests.swift | |
| ) | |
| add_library(TestWebKitAPILibrary OBJECT | |
| ${TESTWEBKITAPI_DIR}/TestWebKitAPILibrary/TestWebKitAPILibrary.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/WTFCompletionHandler+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/WTFExpected+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/AppKit+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/Bundle+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/CocoaTypes.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/Foundation+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPSProxyFramer.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPServer.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPServerBridging.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPServerConnection.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPServerCore.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/HTTPServerRouting.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/HTTPServer/TestCertificates.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/ImageAnalysisTestingUtilities.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/JavaScriptMessages.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/JavaScriptTypes.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/PDFTestHelpers.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/SafeBrowsingTestUtilities.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/SiteIsolationTestUtilities.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/StdLibExtras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/SwiftUI+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/TestCocoaImageUtilities.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/TestPDFDocument.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/WebExtensionUtilities.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/WebPage+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/WebPage+JavaScriptExpression.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/WebPageConfiguration+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/WKWebView+Extras.swift | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.mm | |
| ) | |
| WEBKIT_TEST_SWIFT_HELPER_LIBRARY(TestWebKitAPILibrary TestWebKit) | |
| # The helpers import the WebKit framework built here for its @_spi declarations. | |
| # WebKit_StageSwiftModule is deliberately kept out of WebKit_DEPENDENCIES, so | |
| # without naming it the Swift importer can run before the swiftmodule is staged | |
| # and fall back to the SDK's copy, which does not have them. | |
| add_dependencies(TestWebKitAPILibrary WebKit WebKit_StageSwiftModule) | |
| # WebProcessPlugInWithInternals.mm includes <WebCoreTestSupport/WebCoreTestSupport.h>. An OBJECT | |
| # library doesn't inherit TestWebKit's link libraries, so it needs its own header dependency. | |
| target_link_libraries(TestWebKitAPILibrary PRIVATE WebKit::WebCoreTestSupport) | |
| target_include_directories(TestWebKitAPILibrary PRIVATE | |
| ${TestWebKit_PRIVATE_INCLUDE_DIRECTORIES} | |
| ) | |
| webkit_target_add_swift_options(TestWebKitAPILibrary | |
| "-import-objc-header ${TESTWEBKITAPI_DIR}/Runner/TestWebKitAPI-Bridging-Header.h" | |
| ) | |
| foreach (_target IN ITEMS TestWTF TestWebKit TestWebKitAPILibrary) | |
| WEBKIT_RAISE_SWIFT_NINJA_PRIORITY(${_target} 6) | |
| endforeach () | |
| webkit_target_add_swift_options(TestWebKit "-Xcc -I${CMAKE_SOURCE_DIR}/Source") | |
| list(APPEND TestWebKit_SOURCES | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/AppKitGesturesTestsSupport.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/BasicAppKitGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/DoubleClickGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/EmbeddedAppKitGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/InactiveWindowAppKitGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/QuirksAppKitGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/RefreshControlGesturesTests.swift" | |
| "Tests/WebKit/WebPage/AppKit Gesture Tests/SiteIsolationAppKitGesturesTests.swift" | |
| Tests/WebKit/WKWebView/CodingTests.swift | |
| Tests/WebKit/WKWebView/HTTP2Server.swift | |
| Tests/WebKit/WKWebView/HTTP3Server.swift | |
| Tests/WebKit/WKWebView/SiteIsolationContentsOfAllFramesTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationCookieTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationDataDetectionTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationEditableRegionTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationEditingTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationFullscreenTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationLinkIndicatorTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationLookUpTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationNavigationTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationServiceWorkerTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationSessionStateTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationTextFragmentTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationUIDelegateTests.swift | |
| Tests/WebKit/WKWebView/SiteIsolationUserAgentTests.swift | |
| Tests/WebKit/WKWebView/TextExtractionTests.swift | |
| Tests/WebKit/WKWebView/TextFragments.swift | |
| Tests/WebKit/WKWebView/TextManipulation.swift | |
| Tests/WebKit/WKWebView/TextPlaceholderTests.swift | |
| Tests/WebKit/WKWebView/TextSize.swift | |
| Tests/WebKit/WKWebView/TextWidth.swift | |
| Tests/WebKit/WKWebView/TimeZoneOverride.swift | |
| Tests/WebKit/WKWebView/WKBackForwardListTests.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIAction.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIAlarms.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPICommands.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPICookies.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIDOM.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIDeclarativeNetRequest.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIEvent.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIExtension.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPINamespace.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIOffscreen.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIPermissions.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionAPIWindows.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionControllerConfiguration.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionDataRecord.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionMatchPattern.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionTab.swift | |
| Tests/WebKit/WKWebView/WKWebExtensionWindow.swift | |
| Tests/WebKit/WKWebView/WKWebViewHitTestTests.swift | |
| Tests/WebKit/WKWebView/WKWebViewSwiftOverlayTests.swift | |
| Tests/WebKit/WebPage/ControlledByExternalAgent.swift | |
| Tests/WebKit/WebPage/EditingFontSizeTests.swift | |
| Tests/WebKit/WebPage/JSHandleTests.swift | |
| Tests/WebKit/WebPage/JavaScriptEvaluationTests.swift | |
| Tests/WebKit/WebPage/JavaScriptExpressionTests.swift | |
| Tests/WebKit/WebPage/NavigatorWebDriverOverride.swift | |
| Tests/WebKit/WebPage/SendInspectorMessage.swift | |
| Tests/WebKit/WebPage/SimulateClickOverTextTests.swift | |
| Tests/WebKit/WebPage/URLSchemeHandlerTests.swift | |
| Tests/WebKit/WebPage/UserContentControllerTests.swift | |
| Tests/WebKit/WebPage/WebPageMouseEventsTests.swift | |
| Tests/WebKit/WebPage/WebPageNavigationTests.swift | |
| Tests/WebKit/WebPage/WebPageScrollbarTests.swift | |
| Tests/WebKit/WebPage/WebPageTests.swift | |
| Tests/WebKit/WebPage/WebPageTransferableTests.swift | |
| Tests/WebKit/WebPage/WebViewInspectorAttachmentTests.swift | |
| Tests/WebKit/WebPage/WebViewTests.swift | |
| ) | |
| # FIXME: Needs the Swift overlay in WKUserContentController.swift, which the iOS | |
| # WebKit module can't build yet: it needs the C++ interop the macOS build uses. | |
| if (NOT WEBKIT_SDK_IS_MACOS) | |
| list(REMOVE_ITEM TestWebKit_SOURCES Tests/WebKit/WebPage/UserContentControllerTests.swift) | |
| endif () | |
| # Tests importing both WebKit and SwiftUI load the _WebKit_SwiftUI cross-import | |
| # overlay; ensure it builds first. | |
| list(APPEND TestWebKit_FRAMEWORKS _WebKit_SwiftUI) | |
| # TestWebKitAPIBase needs framework headers for config.h includes. | |
| target_include_directories(TestWebKitAPIBase PRIVATE ${_testapi_framework_headers}) | |
| # TestWebKitAPIInjectedBundle -- .bundle for NSBundle loading. | |
| target_sources(TestWebKitAPIInjectedBundle PRIVATE | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/UtilitiesCocoa.mm | |
| # CustomBundleObject.mm is also in TestWebKit; both targets compile it. | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/CustomBundleObject.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/CustomBundleParameter_Bundle.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/EnableAccessibilityInWebProcess_Bundle.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/ForceLightAppearanceInBundle_Bundle.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/GetBackingScaleFactor_Bundle.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/InjectInternals_Bundle.cpp | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/DidRemoveFrameFromHiearchyInPageCache_Bundle.cpp | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/PasteboardNotifications_Bundle.cpp | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKPage/cocoa/InjectedBundleAppleEvent_Bundle.cpp | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| target_sources(TestWebKitAPIInjectedBundle PRIVATE | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/TestNSBundleExtras.m | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle/mac/InjectedBundleControllerMac.mm | |
| ${TESTWEBKITAPI_DIR}/Helpers/mac/PlatformUtilitiesMac.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/mac/CustomProtocolsInvalidScheme_Bundle.cpp | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKitLegacy/mac/PreventImageLoadWithAutoResizing_Bundle.cpp | |
| ) | |
| else () | |
| target_sources(TestWebKitAPIInjectedBundle PRIVATE | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/PlatformUtilitiesCocoa.mm | |
| ) | |
| endif () | |
| target_include_directories(TestWebKitAPIInjectedBundle PRIVATE | |
| ${_testapi_framework_headers} | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle | |
| ) | |
| # InjectedBundleTestWebKitAPI should use its Info.plist rather than the CMake default. | |
| # EXECUTABLE_NAME and PRODUCT_BUNDLE_IDENTIFIER only exist for the configure_file substitution. | |
| set(EXECUTABLE_NAME InjectedBundleTestWebKitAPI) | |
| set(PRODUCT_BUNDLE_IDENTIFIER com.apple.InjectedBundleTestWebKitAPI) | |
| configure_file("${TESTWEBKITAPI_DIR}/InjectedBundle/InjectedBundle-Info.plist" | |
| "${CMAKE_CURRENT_BINARY_DIR}/InjectedBundle-Info.plist") | |
| unset(EXECUTABLE_NAME) | |
| unset(PRODUCT_BUNDLE_IDENTIFIER) | |
| set_target_properties(TestWebKitAPIInjectedBundle PROPERTIES | |
| BUNDLE TRUE | |
| BUNDLE_EXTENSION bundle | |
| OUTPUT_NAME InjectedBundleTestWebKitAPI | |
| MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/InjectedBundle-Info.plist" | |
| ) | |
| # The InjectedBundle is loaded into a WebKit process that already has WTF. | |
| # WebCoreTestSupport (static) references WTF symbols that the bundle's own | |
| # .o files don't use directly, so the linker can't resolve them at link time. | |
| # Use -undefined dynamic_lookup since the hosting process provides them. | |
| target_link_options(TestWebKitAPIInjectedBundle PRIVATE "LINKER:-undefined,dynamic_lookup") | |
| target_link_libraries(TestWebKitAPIInjectedBundle PRIVATE | |
| JavaScriptCore | |
| WebCoreTestSupport | |
| WebKit | |
| "-framework Foundation" | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| target_link_libraries(TestWebKitAPIInjectedBundle PRIVATE "-framework Cocoa") | |
| endif () | |
| # TestWebKitAPIPlugIn.wkbundle -- modern Cocoa WKWebProcessPlugIn bundle loaded via | |
| # [_WKProcessPoolConfiguration setInjectedBundleURL:] in Util::testPlugInBundleURL(). | |
| # This is a separate product from InjectedBundleTestWebKitAPI.bundle above, | |
| # which implements the legacy C-API injected bundle. | |
| add_library(TestWebKitAPIWebProcessPlugIn MODULE | |
| # Matches the Xcode WebProcessPlugIn target's Helpers membership. Without | |
| # PlatformUtilitiesCocoa.mm's Util::TestPlugInClassNameParameter the bundle | |
| # still links, but fails to dlopen outside the TestWebKitAPI binary. It is in | |
| # SourcesCocoa.txt, hence the #include shim below. | |
| ${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-PlatformUtilitiesCocoa.mm | |
| ${TESTWEBKITAPI_DIR}/Helpers/cocoa/UtilitiesCocoa.mm | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle/cocoa/WebProcessPlugIn/WebProcessPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle/cocoa/WebProcessPlugIn/WebProcessPlugInWithInternals.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/AccessibilityTestPlugin.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/AdditionalReadAccessAllowedURLsPlugin.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/AppPrivacyReportPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BasicProposedCredentialPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BundleCSSStyleDeclarationHandlePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BundleEditingDelegatePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BundleParametersPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BundleRangeHandlePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/BundleRetainPagePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/CancelFontSubresourcePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ClearWrappersNavigatePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ContentFilteringPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ContentWorldPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/GetComputedStyleAfterIframeRemovalPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/InjectedBundleHitTestPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/PageOverlayPlugin.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ParserYieldTokenPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/RemoteObjectRegistryPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/RenderedImageWithOptionsPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/RenderingProgressPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/SchemeChangingPlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/ServiceWorkerPagePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/SkipDecidePolicyForResponsePlugIn.mm | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/UserContentWorldPlugIn.mm | |
| # Also in TestWebKit via SourcesCocoa.txt; WEBKIT_COMPUTE_SOURCES marks the | |
| # originals HEADER_FILE_ONLY, so build them here via #include shims. | |
| ${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-InjectedBundleNodeHandleIsSelectElement.mm | |
| ${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-InjectedBundleNodeHandleIsTextField.mm | |
| ${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-TestAwakener.mm | |
| ) | |
| foreach (_dual_src | |
| InjectedBundleNodeHandleIsSelectElement | |
| InjectedBundleNodeHandleIsTextField | |
| TestAwakener | |
| ) | |
| file(CONFIGURE | |
| OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-${_dual_src}.mm" | |
| CONTENT "#include \"${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView/${_dual_src}.mm\"\n" | |
| @ONLY) | |
| endforeach () | |
| file(CONFIGURE | |
| OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-PlatformUtilitiesCocoa.mm" | |
| CONTENT "#include \"${TESTWEBKITAPI_DIR}/Helpers/cocoa/PlatformUtilitiesCocoa.mm\"\n" | |
| @ONLY) | |
| target_include_directories(TestWebKitAPIWebProcessPlugIn PRIVATE | |
| ${CMAKE_BINARY_DIR} | |
| ${_testapi_framework_headers} | |
| ${TESTWEBKITAPI_DIR} | |
| ${TESTWEBKITAPI_DIR}/InjectedBundle/cocoa/WebProcessPlugIn | |
| ${TESTWEBKITAPI_DIR}/Tests/WebKit/WKWebView | |
| ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR} | |
| ) | |
| # Some pulgins still call -[WKWebProcessPlugInBrowserContextController mainFrame]; | |
| target_compile_options(TestWebKitAPIWebProcessPlugIn PRIVATE -Wno-deprecated-declarations) | |
| # PlatformUtilities.h tests WK_HAVE_C_SPI, which config.h only defines for macOS. | |
| if (NOT WEBKIT_SDK_IS_MACOS) | |
| target_compile_options(TestWebKitAPIWebProcessPlugIn PRIVATE -Wno-undef) | |
| endif () | |
| # PlatformUtilitiesCocoa.mm uses the WebKit C API, which config.h only pulls in | |
| # under BUILDING_TestWebKit, as the sibling test targets also define. | |
| target_compile_definitions(TestWebKitAPIWebProcessPlugIn PRIVATE BUILDING_TestWebKit) | |
| # configure_file substitutes ${EXECUTABLE_NAME}/${PRODUCT_NAME}/ | |
| # ${PRODUCT_BUNDLE_IDENTIFIER} in the Info.plist shared with the Xcode build. | |
| set(EXECUTABLE_NAME TestWebKitAPIPlugIn) | |
| set(PRODUCT_NAME TestWebKitAPIPlugIn) | |
| set(PRODUCT_BUNDLE_IDENTIFIER com.apple.TestWebKitAPIPlugIn) | |
| configure_file( | |
| "${TESTWEBKITAPI_DIR}/InjectedBundle/cocoa/WebProcessPlugIn/Info.plist" | |
| "${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-Info.plist" | |
| ) | |
| unset(EXECUTABLE_NAME) | |
| unset(PRODUCT_NAME) | |
| unset(PRODUCT_BUNDLE_IDENTIFIER) | |
| set_target_properties(TestWebKitAPIWebProcessPlugIn PROPERTIES | |
| BUNDLE TRUE | |
| BUNDLE_EXTENSION wkbundle | |
| OUTPUT_NAME TestWebKitAPIPlugIn | |
| MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/WebProcessPlugIn-Info.plist" | |
| ) | |
| # Same rationale as TestWebKitAPIInjectedBundle: WebCoreTestSupport references | |
| # WTF symbols that the hosting WebContent process provides. | |
| target_link_options(TestWebKitAPIWebProcessPlugIn PRIVATE "LINKER:-undefined,dynamic_lookup") | |
| target_link_libraries(TestWebKitAPIWebProcessPlugIn PRIVATE | |
| JavaScriptCore | |
| WebCoreTestSupport | |
| WebKit | |
| WebKit::gtest | |
| "-framework Foundation" | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| target_link_libraries(TestWebKitAPIWebProcessPlugIn PRIVATE "-framework Cocoa") | |
| endif () | |
| _WEBKIT_ADD_DSYM(TestWebKitAPIWebProcessPlugIn) | |
| # TestWebKit loads this bundle via NSBundle lookup at runtime, so it must be | |
| # built and staged next to the TestWebKitAPI executable. | |
| add_dependencies(TestWebKit TestWebKitAPIWebProcessPlugIn) | |
| # TestWebKitAPIResources.bundle -- test resource files loaded via | |
| # [NSBundle.test_resourcesBundle URLForResource:withExtension:]. | |
| # For a non-.app executable, NSBundle.mainBundle is the directory containing | |
| # the binary, so the .bundle must sit next to the test executables. | |
| # Directory structure under Resources/cocoa/ is preserved -- some tests | |
| # (e.g. WKWebExtension.mm) load entire subdirectories as nested bundles via | |
| # URLForResource:withExtension:@"", which requires web-extension/, *.appex/, | |
| # and *.mlmodelc/ to retain their layout. | |
| set(_resources_bundle_dir "${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPIResources.bundle") | |
| if (WEBKIT_SDK_IS_MACOS) | |
| set(_resources_info_plist "${_resources_bundle_dir}/Contents/Info.plist") | |
| set(_resources_dir "${_resources_bundle_dir}/Contents/Resources") | |
| set(_resources_min_os_key LSMinimumSystemVersion) | |
| else () | |
| set(_resources_info_plist "${_resources_bundle_dir}/Info.plist") | |
| set(_resources_dir "${_resources_bundle_dir}") | |
| set(_resources_min_os_key MinimumOSVersion) | |
| endif () | |
| file(CONFIGURE OUTPUT ${_resources_info_plist} CONTENT [[ | |
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>CFBundleDevelopmentRegion</key> | |
| <string>en</string> | |
| <key>CFBundleIdentifier</key> | |
| <string>com.apple.WebKit.TestWebKitAPIResources</string> | |
| <key>CFBundleInfoDictionaryVersion</key> | |
| <string>6.0</string> | |
| <key>CFBundleName</key> | |
| <string>TestWebKitAPIResources</string> | |
| <key>CFBundlePackageType</key> | |
| <string>BNDL</string> | |
| <key>CFBundleShortVersionString</key> | |
| <string>1.0</string> | |
| <key>CFBundleSupportedPlatforms</key> | |
| <array> | |
| <string>@WEBKIT_PLATFORM_NAME@</string> | |
| </array> | |
| <key>CFBundleVersion</key> | |
| <string>1</string> | |
| <key>@_resources_min_os_key@</key> | |
| <string>@CMAKE_OSX_DEPLOYMENT_TARGET@</string> | |
| </dict> | |
| </plist> | |
| ]] @ONLY) | |
| set(_resources_dst_files) | |
| function(_testwebkitapi_stage_resources source_root skip_pattern) | |
| file(GLOB_RECURSE _entries CONFIGURE_DEPENDS RELATIVE "${source_root}" "${source_root}/*") | |
| foreach (_rel IN LISTS _entries) | |
| if (skip_pattern AND _rel MATCHES "${skip_pattern}") | |
| continue () | |
| endif () | |
| set(_src "${source_root}/${_rel}") | |
| set(_dst "${_resources_dir}/${_rel}") | |
| set(_walk "${_dst}") | |
| while (NOT _walk STREQUAL "${_resources_dir}" AND NOT _walk STREQUAL "/") | |
| get_filename_component(_walk "${_walk}" DIRECTORY) | |
| if (IS_SYMLINK "${_walk}") | |
| file(REMOVE "${_walk}") | |
| endif () | |
| endwhile () | |
| get_filename_component(_dst_dir "${_dst}" DIRECTORY) | |
| file(MAKE_DIRECTORY "${_dst_dir}") | |
| add_custom_command(OUTPUT "${_dst}" | |
| COMMAND ${CMAKE_COMMAND} -E copy "${_src}" "${_dst}" | |
| MAIN_DEPENDENCY "${_src}" | |
| VERBATIM | |
| ) | |
| list(APPEND _resources_dst_files "${_dst}") | |
| endforeach () | |
| set(_resources_dst_files "${_resources_dst_files}" PARENT_SCOPE) | |
| endfunction() | |
| # Top-level Resources/ files go to the bundle root. Skip platform subdirs | |
| # handled separately (cocoa/) or only built for other ports (glib/). | |
| _testwebkitapi_stage_resources("${TESTWEBKITAPI_DIR}/Resources" "^(cocoa|glib)/") | |
| # cocoa/ files (and nested subdirs like web-extension/, *.appex/, *.mlmodelc/) | |
| # are staged with the cocoa/ prefix stripped so paths match what tests pass to | |
| # URLForResource:. | |
| _testwebkitapi_stage_resources("${TESTWEBKITAPI_DIR}/Resources/cocoa" "") | |
| # The shipped quirk table, which the Quirks tests parse. | |
| add_custom_command(OUTPUT "${_resources_dir}/QuirkTable.json" | |
| COMMAND ${CMAKE_COMMAND} -E copy "${WEBCORE_DIR}/page/QuirkTable.json" "${_resources_dir}/QuirkTable.json" | |
| MAIN_DEPENDENCY "${WEBCORE_DIR}/page/QuirkTable.json" | |
| VERBATIM | |
| ) | |
| list(APPEND _resources_dst_files "${_resources_dir}/QuirkTable.json") | |
| add_custom_target(TestWebKitAPIResources ALL DEPENDS ${_resources_dst_files}) | |
| # Ensure all test targets depend on the resources bundle. | |
| foreach (_test_target TestWTF TestJavaScriptCore TestWebCore TestWebKitLegacy TestWebKit TestIPC TestWGSL) | |
| if (TARGET ${_test_target}) | |
| add_dependencies(${_test_target} TestWebKitAPIResources) | |
| endif () | |
| endforeach () | |
| if (WEBKIT_SDK_IS_SIMULATOR) | |
| # run-api-tests spawns the test binaries directly inside the simulator, so, | |
| # as with Xcode's tool products, they must not be app bundles. | |
| set_target_properties(TestWTF TestWebKit TestIPC PROPERTIES MACOSX_BUNDLE FALSE) | |
| if (TARGET TestWGSL) | |
| set_target_properties(TestWGSL PROPERTIES MACOSX_BUNDLE FALSE) | |
| endif () | |
| elseif (WEBKIT_SDK_IS_IOS_FAMILY) | |
| # Bundle ID required for extension scoping. | |
| set_target_properties(TestWebKit PROPERTIES | |
| MACOSX_BUNDLE TRUE | |
| MACOSX_BUNDLE_GUI_IDENTIFIER "org.webkit.TestWebKitAPI" | |
| MACOSX_BUNDLE_BUNDLE_NAME "TestWebKitAPI" | |
| ) | |
| set(_twkapi_bundle_id "org.webkit.TestWebKitAPI") | |
| if (USE_EXTENSIONKIT) | |
| add_dependencies(TestWebKit WebContentExtension NetworkingExtension) | |
| if (ENABLE_GPU_PROCESS) | |
| add_dependencies(TestWebKit GPUExtension) | |
| endif () | |
| WEBKIT_EMBED_EXTENSION(TestWebKit WebContentExtension ${_twkapi_bundle_id} | |
| CHANGE_EXTENSION_POINT ADD_ATS) | |
| WEBKIT_EMBED_EXTENSION(TestWebKit NetworkingExtension ${_twkapi_bundle_id} | |
| ADD_ATS) | |
| if (ENABLE_GPU_PROCESS) | |
| WEBKIT_EMBED_EXTENSION(TestWebKit GPUExtension ${_twkapi_bundle_id}) | |
| endif () | |
| endif () | |
| endif () | |
| # TestIPC | |
| list(APPEND TestIPC_SOURCES | |
| Helpers/cocoa/UtilitiesCocoa.mm | |
| Tests/IPC/IPCSerialization.mm | |
| Tests/IPC/TransferStringObjCTests.mm | |
| ) | |
| list(APPEND TestIPC_PRIVATE_INCLUDE_DIRECTORIES | |
| ${ICU_INCLUDE_DIRS} | |
| ${WTF_FRAMEWORK_HEADERS_DIR} | |
| ${bmalloc_FRAMEWORK_HEADERS_DIR} | |
| ${WEBKIT_DIR}/Platform/cocoa | |
| ${WEBKIT_DIR}/Platform/IPC/darwin | |
| ${WEBKIT_DIR}/Platform/IPC/cocoa | |
| ${WEBKIT_DIR}/Shared/Cocoa | |
| ${WEBKIT_DIR}/Shared/cf | |
| ${WEBKIT_DIR} | |
| ${WEBKIT_DIR}/Platform | |
| ${WEBKIT_DIR}/Platform/IPC | |
| ${WEBKIT_DIR}/Platform/mac | |
| ${WEBKIT_DIR}/Shared | |
| ${WebKit_DERIVED_SOURCES_DIR} | |
| ${WebCore_PRIVATE_FRAMEWORK_HEADERS_DIR} | |
| ) | |
| list(APPEND TestIPC_LIBRARIES | |
| "-framework CoreGraphics" | |
| "-framework CoreServices" | |
| "-framework CoreText" | |
| "-framework CoreVideo" | |
| "-framework ImageIO" | |
| "-framework IOSurface" | |
| "-framework Security" | |
| "-framework UniformTypeIdentifiers" | |
| ) | |
| if (WEBKIT_SDK_IS_MACOS) | |
| list(APPEND TestIPC_LIBRARIES | |
| "-framework Cocoa" | |
| ) | |
| else () | |
| list(APPEND TestIPC_LIBRARIES | |
| "-framework MobileCoreServices" | |
| ) | |
| endif () | |
| WEBKIT_ADD_TARGET_CXX_FLAGS(TestIPC -Wno-deprecated-declarations) |