GMainLoopSource is exposed to race conditions
[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(forwarding-headersGTKForTestWebKitAPI
6     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${FORWARDING_HEADERS_DIR} gtk
7     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${FORWARDING_HEADERS_DIR}  gtk
8     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${WEBKIT2_DIR} ${FORWARDING_HEADERS_DIR} soup
9     COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${FORWARDING_HEADERS_DIR}  soup
10 )
11 set(ForwardingHeadersForTestWebKitAPI_NAME forwarding-headersGTKForTestWebKitAPI)
12
13 include_directories(
14     ${FORWARDING_HEADERS_DIR}
15     ${WEBKIT2_DIR}/UIProcess/API/C/soup
16     ${WEBKIT2_DIR}/UIProcess/API/C/gtk
17     ${WEBKIT2_DIR}/UIProcess/API/gtk
18     ${GDK3_INCLUDE_DIRS}
19     ${GLIB_INCLUDE_DIRS}
20     ${GTK3_INCLUDE_DIRS}
21     ${LIBSOUP_INCLUDE_DIRS}
22 )
23 set(test_main_SOURCES
24     ${TESTWEBKITAPI_DIR}/gtk/main.cpp
25 )
26
27 set(bundle_harness_SOURCES
28     ${TESTWEBKITAPI_DIR}/gtk/InjectedBundleControllerGtk.cpp
29     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
30 )
31
32 set(webkit2_api_harness_SOURCES
33     ${TESTWEBKITAPI_DIR}/gtk/PlatformUtilitiesGtk.cpp
34     ${TESTWEBKITAPI_DIR}/gtk/PlatformWebViewGtk.cpp
35 )
36
37 list(APPEND test_wtf_LIBRARIES
38     ${GDK3_LIBRARIES}
39     ${GTK3_LIBRARIES}
40 )
41
42 list(APPEND test_webkit2_api_LIBRARIES
43     ${GDK3_LIBRARIES}
44     ${GTK3_LIBRARIES}
45 )
46
47 list(APPEND test_webcore_LIBRARIES
48     WebCorePlatformGTK
49     ${GDK3_LIBRARIES}
50     ${GTK3_LIBRARIES}
51 )
52
53 list(APPEND TestWebKitAPI_LIBRARIES
54     ${GDK3_LIBRARIES}
55     ${GTK3_LIBRARIES}
56 )
57
58 list(APPEND TestJavaScriptCore_LIBRARIES
59     ${GDK3_LIBRARIES}
60     ${GTK3_LIBRARIES}
61 )
62
63 add_executable(TestWebKit2
64     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/AboutBlankLoad.cpp
65     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest.cpp
66     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CookieManager.cpp
67     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash.cpp
68     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic.cpp
69     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache.cpp
70     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DownloadDecideDestinationCrash.cpp
71     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/EvaluateJavaScript.cpp
72     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FailedLoad.cpp
73     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Find.cpp
74     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ForceRepaint.cpp
75     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypeHTML.cpp
76     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/FrameMIMETypePNG.cpp
77     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/Geolocation.cpp
78     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback.cpp
79     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle.cpp
80     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic.cpp
81     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleFrameHitTest.cpp
82     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins.cpp
83     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadAlternateHTMLStringWithNonDirectoryURL.cpp
84     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback.cpp
85     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadPageOnCrash.cpp
86     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash.cpp
87     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout.cpp
88     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails.cpp
89     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages.cpp
90     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames.cpp
91     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadBasic.cpp
92     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PageLoadDidChangeLocationWithinPageForFrame.cpp
93     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame.cpp
94     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PreventEmptyUserAgent.cpp
95     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/PrivateBrowsingPushStateNoHistoryCallback.cpp
96     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ReloadPageAfterCrash.cpp
97     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResizeWindowAfterCrash.cpp
98     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/RestoreSessionStateContainingFormData.cpp
99     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem.cpp
100     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
103     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
104     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
105     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
107 )
108
109 target_link_libraries(TestWebKit2 ${test_webkit2_api_LIBRARIES})
110 add_test(TestWebKit2 ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
111 set_tests_properties(TestWebKit2 PROPERTIES TIMEOUT 60)
112 set_target_properties(TestWebKit2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
113
114 set(TestWebCoreGtk_SOURCES
115     ${WEBCORE_DIR}/platform/graphics/IntPoint.cpp
116     ${WEBCORE_DIR}/platform/graphics/IntRect.cpp
117     ${WEBCORE_DIR}/platform/graphics/IntSize.cpp
118     ${WEBCORE_DIR}/platform/graphics/cairo/IntRectCairo.cpp
119     ${WEBCORE_DIR}/platform/graphics/gtk/IntRectGtk.cpp
120     ${WEBCORE_DIR}/platform/gtk/GtkInputMethodFilter.cpp
121     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/InputMethodFilter.cpp
122     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/UserAgentQuirks.cpp
123 )
124
125 add_executable(TestWebCore
126     ${test_main_SOURCES}
127     ${TestWebCoreGtk_SOURCES}
128     ${TESTWEBKITAPI_DIR}/TestsController.cpp
129     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
130     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
131 )
132
133 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
134 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
135 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
136 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
137
138 list(APPEND TestWTF_SOURCES
139     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GMainLoopSource.cpp
140     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GUniquePtr.cpp
141 )