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