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