[GTK] Expose WebKitSecurityOrigin API
[WebKit-https.git] / Tools / TestWebKitAPI / Tests / WebKit2Gtk / CMakeLists.txt
1 set(TEST_LIBRARY_DIR ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/WebKit2GtkAPITests)
2 set(TEST_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/TestWebKitAPI/WebKit2Gtk)
3 set(TEST_RESOURCES_DIR ${TEST_BINARY_DIR}/resources)
4 file(MAKE_DIRECTORY ${TEST_RESOURCES_DIR})
5
6 add_definitions(
7     -DWEBKIT_TEST_PLUGIN_DIR="${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/plugins"
8     -DWEBKIT_EXEC_PATH="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
9     -DWEBKIT_SRC_DIR="${CMAKE_SOURCE_DIR}"
10     -DWEBKIT_TEST_WEB_EXTENSIONS_DIR="${TEST_LIBRARY_DIR}"
11     -DWEBKIT_INJECTED_BUNDLE_PATH="${CMAKE_LIBRARY_OUTPUT_DIRECTORY}"
12 )
13
14 include_directories(
15     ${CMAKE_SOURCE_DIR}/Source
16     ${CMAKE_SOURCE_DIR}/Source/WTF
17     ${DERIVED_SOURCES_WEBKIT2GTK_DIR}
18     ${FORWARDING_HEADERS_DIR}
19     ${FORWARDING_HEADERS_WEBKIT2GTK_DIR}
20     ${FORWARDING_HEADERS_WEBKIT2GTK_EXTENSION_DIR}
21     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk
22 )
23
24 include_directories(SYSTEM
25     ${ATSPI_INCLUDE_DIRS}
26     ${GLIB_INCLUDE_DIRS}
27     ${GSTREAMER_INCLUDE_DIRS}
28     ${GTK3_INCLUDE_DIRS}
29     ${GTK_UNIX_PRINT_INCLUDE_DIRS}
30     ${LIBSOUP_INCLUDE_DIRS}
31 )
32
33 add_library(WebKit2APITestCore STATIC
34     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/LoadTrackingTest.cpp
35     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestBus.cpp
36     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebKitTestServer.cpp
37     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/TestMain.cpp
38     ${TOOLS_DIR}/TestWebKitAPI/gtk/WebKit2Gtk/WebViewTest.cpp
39 )
40 target_link_libraries(WebKit2APITestCore WebKit2)
41
42 add_custom_command(
43     OUTPUT ${TEST_RESOURCES_DIR}/webkit2gtk-tests-resources.gresource
44     DEPENDS resources/webkit2gtk-tests.gresource.xml
45             resources/link-title.js
46     COMMAND glib-compile-resources
47             --target=${TEST_RESOURCES_DIR}/webkit2gtk-tests-resources.gresource
48             --sourcedir=${CMAKE_SOURCE_DIR}
49             ${CMAKE_CURRENT_LIST_DIR}/resources/webkit2gtk-tests.gresource.xml
50 )
51
52 add_custom_target(test-gresource-bundle
53     DEPENDS ${TEST_RESOURCES_DIR}/webkit2gtk-tests-resources.gresource
54 )
55
56 macro(ADD_WK2_TEST_WEB_EXTENSION extension_name)
57     add_library(${extension_name} MODULE ${ARGN})
58     add_dependencies(${extension_name} WebKit2)
59     set_property(
60         TARGET ${extension_name}
61         APPEND
62         PROPERTY COMPILE_DEFINITIONS WEBKIT2_COMPILATION
63     )
64     set_target_properties(${extension_name} PROPERTIES
65         LIBRARY_OUTPUT_DIRECTORY ${TEST_LIBRARY_DIR}
66     )
67     target_link_libraries(${extension_name}
68         JavaScriptCore
69         WebKit2
70         ${GLIB_LIBRARIES}
71     )
72 endmacro()
73
74 macro(ADD_WK2_TEST test_name)
75     add_executable(${test_name} ${ARGN})
76     add_dependencies(${test_name}
77         test-gresource-bundle
78         WebExtensionTest
79     )
80     target_link_libraries(${test_name}
81         JavaScriptCore
82         WebKit2
83         WebKit2APITestCore
84         ${ATSPI_LIBRARIES}
85         ${GLIB_LIBRARIES}
86         ${GTK3_LIBRARIES}
87         ${GTK_UNIX_PRINT_LIBRARIES}
88         ${LIBSOUP_LIBRARIES}
89     )
90     set_target_properties(${test_name} PROPERTIES
91         RUNTIME_OUTPUT_DIRECTORY ${TEST_BINARY_DIR}
92     )
93 endmacro()
94
95 ADD_WK2_TEST_WEB_EXTENSION(WebExtensionTest WebExtensionTest.cpp)
96 ADD_WK2_TEST_WEB_EXTENSION(WebProcessTest AutocleanupsTest.cpp DOMNodeTest.cpp DOMNodeFilterTest.cpp DOMXPathNSResolverTest.cpp FrameTest.cpp WebProcessTest.cpp EditorTest.cpp)
97
98 ADD_WK2_TEST(InspectorTestServer InspectorTestServer.cpp)
99 ADD_WK2_TEST(TestAuthentication TestAuthentication.cpp)
100 ADD_WK2_TEST(TestAutocleanups TestAutocleanups.cpp)
101 ADD_WK2_TEST(TestBackForwardList TestBackForwardList.cpp)
102 ADD_WK2_TEST(TestContextMenu TestContextMenu.cpp)
103 ADD_WK2_TEST(TestCookieManager TestCookieManager.cpp)
104 ADD_WK2_TEST(TestDOMNode TestDOMNode.cpp)
105 ADD_WK2_TEST(TestDOMNodeFilter TestDOMNodeFilter.cpp)
106 ADD_WK2_TEST(TestDOMXPathNSResolver TestDOMXPathNSResolver.cpp)
107 ADD_WK2_TEST(TestDownloads TestDownloads.cpp)
108 ADD_WK2_TEST(TestWebKitFaviconDatabase TestWebKitFaviconDatabase.cpp)
109 ADD_WK2_TEST(TestWebKitFindController TestWebKitFindController.cpp)
110 ADD_WK2_TEST(TestFrame TestFrame.cpp)
111 ADD_WK2_TEST(TestInspector TestInspector.cpp)
112 ADD_WK2_TEST(TestInspectorServer TestInspectorServer.cpp)
113 ADD_WK2_TEST(TestLoaderClient TestLoaderClient.cpp)
114 ADD_WK2_TEST(TestMultiprocess TestMultiprocess.cpp)
115 ADD_WK2_TEST(TestPrinting TestPrinting.cpp)
116 ADD_WK2_TEST(TestResources TestResources.cpp)
117 ADD_WK2_TEST(TestSSL TestSSL.cpp)
118 ADD_WK2_TEST(TestUIClient TestUIClient.cpp)
119 ADD_WK2_TEST(TestWebExtensions TestWebExtensions.cpp)
120 ADD_WK2_TEST(TestWebKitPolicyClient TestWebKitPolicyClient.cpp)
121 ADD_WK2_TEST(TestWebKitSecurityOrigin TestWebKitSecurityOrigin.cpp)
122 ADD_WK2_TEST(TestWebKitSettings TestWebKitSettings.cpp)
123 ADD_WK2_TEST(TestWebKitVersion TestWebKitVersion.cpp)
124 ADD_WK2_TEST(TestWebViewEditor TestWebViewEditor.cpp)
125 ADD_WK2_TEST(TestWebKitWebContext TestWebKitWebContext.cpp)
126 ADD_WK2_TEST(TestWebKitWebView TestWebKitWebView.cpp)
127 ADD_WK2_TEST(TestWebKitUserContentManager TestWebKitUserContentManager.cpp)
128 ADD_WK2_TEST(TestEditor TestEditor.cpp)
129 ADD_WK2_TEST(TestConsoleMessage TestConsoleMessage.cpp)
130
131 if (ATSPI_FOUND)
132     ADD_WK2_TEST(AccessibilityTestServer AccessibilityTestServer.cpp)
133     ADD_WK2_TEST(TestWebKitAccessibility TestWebKitAccessibility.cpp)
134 endif ()