[GTK] Enable seccomp filter API tests
[WebKit-https.git] / Tools / TestWebKitAPI / PlatformGTK.cmake
1 # This is necessary because it is possible to build TestWebKitAPI with WebKit2
2 # disabled and this triggers the inclusion of the WebKit2 headers.
3 add_definitions(-DBUILDING_WEBKIT2__)
4
5 add_custom_target(TestWebKitAPI-forwarding-headers
6     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl --include-path ${TESTWEBKITAPI_DIR} --output ${FORWARDING_HEADERS_DIR} --platform gtk --platform soup
7     DEPENDS WebKit2-forwarding-headers
8 )
9
10 set(ForwardingHeadersForTestWebKitAPI_NAME TestWebKitAPI-forwarding-headers)
11
12 include_directories(
13     ${FORWARDING_HEADERS_DIR}
14     ${FORWARDING_HEADERS_DIR}/JavaScriptCore
15     ${WEBKIT2_DIR}/UIProcess/API/C/soup
16     ${WEBKIT2_DIR}/UIProcess/API/C/gtk
17     ${WEBKIT2_DIR}/UIProcess/API/gtk
18 )
19
20 include_directories(SYSTEM
21     ${GDK3_INCLUDE_DIRS}
22     ${GLIB_INCLUDE_DIRS}
23     ${GTK3_INCLUDE_DIRS}
24     ${LIBSOUP_INCLUDE_DIRS}
25 )
26
27 set(test_main_SOURCES
28     ${TESTWEBKITAPI_DIR}/gtk/main.cpp
29 )
30
31 set(bundle_harness_SOURCES
32     ${TESTWEBKITAPI_DIR}/gtk/InjectedBundleControllerGtk.cpp
33     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
34 )
35
36 set(webkit2_api_harness_SOURCES
37     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
38     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
39 )
40
41 list(APPEND test_wtf_LIBRARIES
42     ${GDK3_LIBRARIES}
43     ${GTK3_LIBRARIES}
44 )
45
46 list(APPEND test_webkit2_api_LIBRARIES
47     ${GDK3_LIBRARIES}
48     ${GTK3_LIBRARIES}
49 )
50
51 list(APPEND test_webcore_LIBRARIES
52     WebCorePlatformGTK
53     ${GDK3_LIBRARIES}
54     ${GTK3_LIBRARIES}
55 )
56
57 list(APPEND TestWebKitAPI_LIBRARIES
58     ${GDK3_LIBRARIES}
59     ${GTK3_LIBRARIES}
60 )
61
62 list(APPEND TestJavaScriptCore_LIBRARIES
63     ${GDK3_LIBRARIES}
64     ${GTK3_LIBRARIES}
65 )
66
67 add_executable(TestWebKit2
68     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/AboutBlankLoad.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CookieManager.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DownloadDecideDestinationCrash.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/EvaluateJavaScript.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FailedLoad.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Find.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ForceRepaint.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypeHTML.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypePNG.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Geolocation.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadPageOnCrash.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
92     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
93     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
94     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
95     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadBasic.cpp
96     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
97     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame.cpp
98     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
99     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
100     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ReloadPageAfterCrash.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResizeWindowAfterCrash.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp
103     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
104     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/TextFieldDidBeginAndEndEditing.cpp
105     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMedia.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage.cpp
107     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
108     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
109     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
110     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
111     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
112     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
113     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/gtk/InputMethodFilter.cpp
114 )
115
116 target_link_libraries(TestWebKit2 ${test_webkit2_api_LIBRARIES})
117 add_test(TestWebKit2 ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
118 set_tests_properties(TestWebKit2 PROPERTIES TIMEOUT 60)
119 set_target_properties(TestWebKit2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
120
121 if (ENABLE_SECCOMP_FILTERS)
122     # This test needs to be in its own executable. It's a general test of the
123     # seccomp filter mechanism, and the filters it sets are incompatible with
124     # the correct operation of WebKit and the other tests.
125     add_executable(TestSeccompFilters
126         ${TESTWEBKITAPI_DIR}/Tests/WebKit2/SeccompFilters.cpp
127     )
128
129     target_link_libraries(TestSeccompFilters ${test_webkit2_api_LIBRARIES})
130     add_test(TestSeccompFilters ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
131     set_tests_properties(TestSeccompFilters PROPERTIES TIMEOUT 5)
132     set_target_properties(TestSeccompFilters PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
133 endif ()
134
135 set(TestWebCoreGtk_SOURCES
136     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/UserAgentQuirks.cpp
137 )
138
139 add_executable(TestWebCore
140     ${test_main_SOURCES}
141     ${TestWebCoreGtk_SOURCES}
142     ${TESTWEBKITAPI_DIR}/TestsController.cpp
143     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
144     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
145     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
146     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
147     ${TESTWEBKITAPI_DIR}/Tests/WebCore/PublicSuffix.cpp
148 )
149
150 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
151 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
152
153 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
154 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
155 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
156
157 list(APPEND TestWTF_SOURCES
158     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GMainLoopSource.cpp
159     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/GUniquePtr.cpp
160     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
161 )