[GTK] Move MainThreadGtk, RunLoopGtk, WorkQueueGtk under Source/WTF/wtf/glib/
[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     ${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/UserMedia.cpp
101     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage.cpp
102     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent.cpp
103     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPageGetScaleFactorNotZero.cpp
104     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKPreferences.cpp
105     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKString.cpp
106     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKStringJSString.cpp
107     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKURL.cpp
108     ${TESTWEBKITAPI_DIR}/Tests/WebKit2/gtk/InputMethodFilter.cpp
109 )
110
111 target_link_libraries(TestWebKit2 ${test_webkit2_api_LIBRARIES})
112 add_test(TestWebKit2 ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2/TestWebKit2)
113 set_tests_properties(TestWebKit2 PROPERTIES TIMEOUT 60)
114 set_target_properties(TestWebKit2 PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebKit2)
115
116 set(TestWebCoreGtk_SOURCES
117     ${TESTWEBKITAPI_DIR}/Tests/WebCore/gtk/UserAgentQuirks.cpp
118 )
119
120 add_executable(TestWebCore
121     ${test_main_SOURCES}
122     ${TestWebCoreGtk_SOURCES}
123     ${TESTWEBKITAPI_DIR}/TestsController.cpp
124     ${TESTWEBKITAPI_DIR}/Tests/WebCore/LayoutUnit.cpp
125     ${TESTWEBKITAPI_DIR}/Tests/WebCore/URL.cpp
126     ${TESTWEBKITAPI_DIR}/Tests/WebCore/SharedBuffer.cpp
127     ${TESTWEBKITAPI_DIR}/Tests/WebCore/FileSystem.cpp
128 )
129
130 target_link_libraries(TestWebCore ${test_webcore_LIBRARIES})
131 add_dependencies(TestWebCore ${ForwardingHeadersForTestWebKitAPI_NAME})
132
133 add_test(TestWebCore ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore/TestWebCore)
134 set_tests_properties(TestWebCore PROPERTIES TIMEOUT 60)
135 set_target_properties(TestWebCore PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${TESTWEBKITAPI_RUNTIME_OUTPUT_DIRECTORY}/WebCore)
136
137 list(APPEND TestWTF_SOURCES
138     ${TESTWEBKITAPI_DIR}/Tests/WTF/glib/WorkQueueGLib.cpp
139     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GMainLoopSource.cpp
140     ${TESTWEBKITAPI_DIR}/Tests/WTF/gobject/GUniquePtr.cpp
141 )