Diff
Modified: trunk/Tools/CMakeLists.txt (122972 => 122973)
--- trunk/Tools/CMakeLists.txt 2012-07-18 15:04:17 UTC (rev 122972)
+++ trunk/Tools/CMakeLists.txt 2012-07-18 15:07:34 UTC (rev 122973)
@@ -14,3 +14,7 @@
ELSEIF ("${PORT}" STREQUAL "WinCE")
ADD_SUBDIRECTORY(WinCELauncher)
ENDIF()
+
+IF (ENABLE_WEBKIT2 AND ENABLE_API_TESTS)
+ ADD_SUBDIRECTORY(TestWebKitAPI)
+ENDIF()
Modified: trunk/Tools/ChangeLog (122972 => 122973)
--- trunk/Tools/ChangeLog 2012-07-18 15:04:17 UTC (rev 122972)
+++ trunk/Tools/ChangeLog 2012-07-18 15:07:34 UTC (rev 122973)
@@ -1,5 +1,43 @@
2012-07-18 Thiago Marcos P. Santos <[email protected]>
+ [CMake][EFL] Build and run TestWebKitAPI unit tests
+ https://bugs.webkit.org/show_bug.cgi?id=90671
+
+ Reviewed by Daniel Bates.
+
+ This patch enables almost for free a significant amount of test for the
+ WebKit C API, WTF and KURL. It makes easy for CMake based ports to
+ enable TestWebKitAPI since the missing bits to implement are
+ relatively simple.
+
+ * CMakeLists.txt:
+ * TestWebKitAPI/CMakeLists.txt: Added.
+ * TestWebKitAPI/PlatformEfl.cmake: Added.
+ * TestWebKitAPI/PlatformWebView.h:
+ * TestWebKitAPI/config.h:
+ * TestWebKitAPI/efl/InjectedBundleController.cpp: Added.
+ (TestWebKitAPI):
+ (TestWebKitAPI::InjectedBundleController::platformInitialize):
+ * TestWebKitAPI/efl/PlatformUtilities.cpp: Added.
+ (TestWebKitAPI):
+ (Util):
+ (TestWebKitAPI::Util::run):
+ (TestWebKitAPI::Util::sleep):
+ (TestWebKitAPI::Util::createURLForResource):
+ (TestWebKitAPI::Util::createInjectedBundlePath):
+ (TestWebKitAPI::Util::URLForNonExistentResource):
+ * TestWebKitAPI/efl/PlatformWebView.cpp: Added.
+ (TestWebKitAPI):
+ (TestWebKitAPI::initEcoreEvas):
+ (TestWebKitAPI::PlatformWebView::PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::~PlatformWebView):
+ (TestWebKitAPI::PlatformWebView::page):
+ * TestWebKitAPI/efl/main.cpp: Added.
+ (checkForUseX11WindowArgument):
+ (main):
+
+2012-07-18 Thiago Marcos P. Santos <[email protected]>
+
[CMake][EFL] Building jsc causes reconfiguration
https://bugs.webkit.org/show_bug.cgi?id=91387
Added: trunk/Tools/TestWebKitAPI/CMakeLists.txt (0 => 122973)
--- trunk/Tools/TestWebKitAPI/CMakeLists.txt (rev 0)
+++ trunk/Tools/TestWebKitAPI/CMakeLists.txt 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,135 @@
+SET(TESTWEBKITAPI_DIR "${TOOLS_DIR}/TestWebKitAPI")
+
+INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}
+ ${TESTWEBKITAPI_DIR}
+ ${CMAKE_SOURCE_DIR}/Source
+ ${DERIVED_SOURCES_WEBKIT2_DIR}/include
+ ${_javascript_CORE_DIR}
+ ${_javascript_CORE_DIR}/API
+ ${_javascript_CORE_DIR}/ForwardingHeaders
+ ${THIRDPARTY_DIR}/gtest/include
+ ${WEBCORE_DIR}/editing
+ ${WEBCORE_DIR}/platform
+ ${WEBCORE_DIR}/platform/graphics
+ ${WEBCORE_DIR}/platform/text
+ ${WEBCORE_DIR}/platform/network
+ ${WEBKIT2_DIR}/Shared
+ ${WEBKIT2_DIR}/Shared/API/c
+ ${WEBKIT2_DIR}/UIProcess
+ ${WTF_DIR}
+)
+
+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS()
+
+ADD_LIBRARY(TestWebKitAPIInjectedBundle SHARED
+ ${bundle_harness_SOURCES}
+ ${TESTWEBKITAPI_DIR}/InjectedBundleController.cpp
+ ${TESTWEBKITAPI_DIR}/InjectedBundleMain.cpp
+ ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/CanHandleRequest_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionBasic_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DOMWindowExtensionNoCache_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/DocumentStartUserScriptAlertCrash_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/GetInjectedBundleInitializationUserDataCallback_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/HitTestResultNodeHandle_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleBasic_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/InjectedBundleInitializationUserDataCallbackWins_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/LoadCanceledNoServerRedirectCallback_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/MouseMoveAfterCrash_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFails_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutForImages_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayoutFrames_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/NewFirstVisuallyNonEmptyLayout_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ParentFrame_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ResponsivenessTimerDoesntFireEarly_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/ShouldGoToBackForwardListItem_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/UserMessage_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WKConnection_Bundle.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebKit2/WillSendSubmitEvent_Bundle.cpp
+)
+
+ADD_DEPENDENCIES(TestWebKitAPIInjectedBundle ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+
+GET_PROPERTY(TestWebKitAPIInjectedBundle_PATH TARGET TestWebKitAPIInjectedBundle PROPERTY LOCATION)
+
+ADD_DEFINITIONS(-DGTEST_LINKED_AS_SHARED_LIBRARY=1
+ -DTEST_WEBKIT2_RESOURCES_DIR=\"${TESTWEBKITAPI_DIR}/Tests/WebKit2\"
+ -DTEST_INJECTED_BUNDLE_PATH=\"${TestWebKitAPIInjectedBundle_PATH}\"
+)
+
+SET(test_wtf_LIBRARIES
+ ${WTF_LIBRARY_NAME}
+ gtest
+)
+
+ADD_EXECUTABLE(test_wtf
+ ${test_main_SOURCES}
+ ${TESTWEBKITAPI_DIR}/TestsController.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/CheckedArithmeticOperations.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/Functional.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/HashMap.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/MetaAllocator.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/RedBlackTree.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/StringBuilder.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/StringOperators.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/TemporaryChange.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/Vector.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorBasic.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WTF/VectorReverse.cpp
+)
+
+TARGET_LINK_LIBRARIES(test_wtf ${test_wtf_LIBRARIES})
+ADD_DEPENDENCIES(test_wtf ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+ADD_TEST(test_wtf ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_wtf)
+SET_TESTS_PROPERTIES(test_wtf PROPERTIES TIMEOUT 60)
+
+SET(test_webcore_LIBRARIES
+ ${WTF_LIBRARY_NAME}
+ ${WebCore_LIBRARY_NAME}
+ gtest
+)
+
+ADD_EXECUTABLE(test_webcore
+ ${test_main_SOURCES}
+ ${TESTWEBKITAPI_DIR}/TestsController.cpp
+ ${TESTWEBKITAPI_DIR}/Tests/WebCore/KURL.cpp
+)
+
+TARGET_LINK_LIBRARIES(test_webcore ${test_webcore_LIBRARIES})
+ADD_DEPENDENCIES(test_webcore ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+ADD_TEST(test_webcore ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webcore)
+SET_TESTS_PROPERTIES(test_webcore PROPERTIES TIMEOUT 60)
+
+ADD_LIBRARY(TestWebKitAPIBase
+ ${test_main_SOURCES}
+ ${webkit2_api_harness_SOURCES}
+ ${TESTWEBKITAPI_DIR}/_javascript_Test.cpp
+ ${TESTWEBKITAPI_DIR}/PlatformUtilities.cpp
+ ${TESTWEBKITAPI_DIR}/TestsController.cpp
+)
+
+ADD_DEPENDENCIES(TestWebKitAPIBase ${WebKit2_LIBRARY_NAME} ${ForwardingHeadersForTestWebKitAPI_NAME} ${ForwardingNetworkHeadersForTestWebKitAPI_NAME})
+
+SET(test_webkit2_api_LIBRARIES
+ TestWebKitAPIBase
+ ${WTF_LIBRARY_NAME}
+ ${_javascript_Core_LIBRARY_NAME}
+ ${WebKit2_LIBRARY_NAME}
+ gtest
+)
+
+FOREACH(testName ${test_webkit2_api_BINARIES})
+ ADD_EXECUTABLE(test_webkit2_api_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+ ADD_TEST(test_webkit2_api_${testName} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test_webkit2_api_${testName})
+ SET_TESTS_PROPERTIES(test_webkit2_api_${testName} PROPERTIES TIMEOUT 60)
+ TARGET_LINK_LIBRARIES(test_webkit2_api_${testName} ${test_webkit2_api_LIBRARIES})
+ENDFOREACH()
+
+# We don't run tests that are expected to fail. We could use the WILL_FAIL
+# property, but it reports failure when the test crashes or timeouts and would
+# make the bot red.
+
+FOREACH(testName ${test_webkit2_api_fail_BINARIES})
+ ADD_EXECUTABLE(test_webkit2_api_fail_${testName} ${TESTWEBKITAPI_DIR}/Tests/WebKit2/${testName}.cpp)
+ TARGET_LINK_LIBRARIES(test_webkit2_api_fail_${testName} ${test_webkit2_api_LIBRARIES})
+ENDFOREACH()
Added: trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (0 => 122973)
--- trunk/Tools/TestWebKitAPI/PlatformEfl.cmake (rev 0)
+++ trunk/Tools/TestWebKitAPI/PlatformEfl.cmake 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,91 @@
+ADD_CUSTOM_TARGET(forwarding-headersEflForTestWebKitAPI
+ COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include efl
+)
+SET(ForwardingHeadersForTestWebKitAPI_NAME forwarding-headersEflForTestWebKitAPI)
+
+ADD_CUSTOM_TARGET(forwarding-headersSoupForTestWebKitAPI
+ COMMAND ${PERL_EXECUTABLE} ${WEBKIT2_DIR}/Scripts/generate-forwarding-headers.pl ${TESTWEBKITAPI_DIR} ${DERIVED_SOURCES_WEBKIT2_DIR}/include soup
+)
+SET(ForwardingNetworkHeadersForTestWebKitAPI_NAME forwarding-headersSoupForTestWebKitAPI)
+
+INCLUDE_DIRECTORIES(${LIBSOUP24_INCLUDE_DIRS}
+ ${WEBKIT2_DIR}/UIProcess/API/C/soup
+ ${WEBKIT2_DIR}/UIProcess/API/C/efl
+ ${ECORE_INCLUDE_DIRS}
+ ${EINA_INCLUDE_DIRS}
+ ${EVAS_INCLUDE_DIRS}
+)
+
+SET(test_main_SOURCES
+ ${TESTWEBKITAPI_DIR}/efl/main.cpp
+)
+
+SET(bundle_harness_SOURCES
+ ${TESTWEBKITAPI_DIR}/efl/InjectedBundleController.cpp
+ ${TESTWEBKITAPI_DIR}/efl/PlatformUtilities.cpp
+)
+
+SET(webkit2_api_harness_SOURCES
+ ${TESTWEBKITAPI_DIR}/efl/PlatformUtilities.cpp
+ ${TESTWEBKITAPI_DIR}/efl/PlatformWebView.cpp
+)
+
+# The list below works like a test expectation. Tests in the
+# test_webkit2_api_BINARIES list are added to the test runner and
+# tried on the bots on every build. Tests in test_webkit2_api_fail_BINARIES
+# are compiled and suffixed with fail and skipped from the test runner.
+#
+# Make sure that the tests are passing on both Debug and
+# Release builds before adding it to test_webkit2_api_BINARIES.
+
+SET(test_webkit2_api_BINARIES
+ CookieManager
+ DOMWindowExtensionNoCache
+ DocumentStartUserScriptAlertCrash
+ EvaluateJavaScript
+ FailedLoad
+ Find
+ ForceRepaint
+ FrameMIMETypeHTML
+ FrameMIMETypePNG
+ GetInjectedBundleInitializationUserDataCallback
+ InjectedBundleBasic
+ InjectedBundleInitializationUserDataCallbackWins
+ LoadAlternateHTMLStringWithNonDirectoryURL
+ LoadCanceledNoServerRedirectCallback
+ NewFirstVisuallyNonEmptyLayout
+ NewFirstVisuallyNonEmptyLayoutFails
+ PageLoadBasic
+ PageLoadDidChangeLocationWithinPageForFrame
+ ParentFrame
+ PreventEmptyUserAgent
+ PrivateBrowsingPushStateNoHistoryCallback
+ WKConnection
+ WKString
+ WKStringJSString
+ WillSendSubmitEvent
+)
+
+SET(test_webkit2_api_fail_BINARIES
+ CanHandleRequest
+ DOMWindowExtensionBasic
+ DownloadDecideDestinationCrash
+ NewFirstVisuallyNonEmptyLayoutForImages
+ NewFirstVisuallyNonEmptyLayoutFrames
+ RestoreSessionStateContainingFormData
+ ShouldGoToBackForwardListItem
+ WKPageGetScaleFactorNotZero
+)
+
+# Tests disabled because of missing features on the test harness:
+#
+# AboutBlankLoad
+# HitTestResultNodeHandle
+# MouseMoveAfterCrash
+# ResponsivenessTimerDoesntFireEarly
+# SpacebarScrolling
+# WKPreferences
+#
+# Flaky test, fails on Release but passes on Debug:
+#
+# UserMessage
Modified: trunk/Tools/TestWebKitAPI/PlatformWebView.h (122972 => 122973)
--- trunk/Tools/TestWebKitAPI/PlatformWebView.h 2012-07-18 15:04:17 UTC (rev 122972)
+++ trunk/Tools/TestWebKitAPI/PlatformWebView.h 2012-07-18 15:07:34 UTC (rev 122973)
@@ -46,6 +46,11 @@
#elif PLATFORM(GTK)
typedef WKViewRef PlatformWKView;
typedef GtkWidget *PlatformWindow;
+#elif PLATFORM(EFL)
+typedef struct _Evas_Object Evas_Object;
+typedef struct _Ecore_Evas Ecore_Evas;
+typedef Evas_Object* PlatformWKView;
+typedef Ecore_Evas* PlatformWindow;
#endif
namespace TestWebKitAPI {
Modified: trunk/Tools/TestWebKitAPI/config.h (122972 => 122973)
--- trunk/Tools/TestWebKitAPI/config.h 2012-07-18 15:04:17 UTC (rev 122972)
+++ trunk/Tools/TestWebKitAPI/config.h 2012-07-18 15:07:34 UTC (rev 122973)
@@ -23,6 +23,12 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
+#ifdef BUILDING_WITH_CMAKE
+#include "cmakeconfig.h"
+#endif
+#endif
+
#include <wtf/Platform.h>
#include <wtf/ExportMacros.h>
#if USE(JSC)
Copied: trunk/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp (from rev 122972, trunk/Tools/TestWebKitAPI/config.h) (0 => 122973)
--- trunk/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp (rev 0)
+++ trunk/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2012 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "InjectedBundleController.h"
+
+namespace TestWebKitAPI {
+
+void InjectedBundleController::platformInitialize()
+{
+}
+
+} // namespace TestWebKitAPI
Copied: trunk/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp (from rev 122972, trunk/Tools/TestWebKitAPI/config.h) (0 => 122973)
--- trunk/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp (rev 0)
+++ trunk/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformUtilities.h"
+
+#include <Ecore.h>
+#include <stdio.h>
+#include <unistd.h>
+
+namespace TestWebKitAPI {
+
+namespace Util {
+
+void run(bool* done)
+{
+ while (!*done)
+ ecore_main_loop_iterate();
+}
+
+void sleep(double seconds)
+{
+ sleep(seconds);
+}
+
+WKURLRef createURLForResource(const char* resource, const char* extension)
+{
+ char url[PATH_MAX];
+
+ snprintf(url, sizeof(url), "file://%s/%s.%s", TEST_WEBKIT2_RESOURCES_DIR, resource, extension);
+
+ return WKURLCreateWithUTF8CString(url);
+}
+
+WKStringRef createInjectedBundlePath()
+{
+ return WKStringCreateWithUTF8CString(TEST_INJECTED_BUNDLE_PATH);
+}
+
+WKURLRef URLForNonExistentResource()
+{
+ return WKURLCreateWithUTF8CString("file:///does-not-exist.html");
+}
+
+} // namespace Util
+
+} // namespace TestWebKitAPI
Copied: trunk/Tools/TestWebKitAPI/efl/PlatformWebView.cpp (from rev 122972, trunk/Tools/TestWebKitAPI/config.h) (0 => 122973)
--- trunk/Tools/TestWebKitAPI/efl/PlatformWebView.cpp (rev 0)
+++ trunk/Tools/TestWebKitAPI/efl/PlatformWebView.cpp 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "PlatformWebView.h"
+
+#include "WebKit2/WKAPICast.h"
+#include <Ecore_Evas.h>
+
+extern bool useX11Window;
+
+using namespace WebKit;
+
+namespace TestWebKitAPI {
+
+static Ecore_Evas* initEcoreEvas()
+{
+ ASSERT(ecore_evas_init());
+
+ Ecore_Evas* ecoreEvas;
+
+ if (useX11Window)
+ ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
+ else
+ ecoreEvas = ecore_evas_buffer_new(800, 600);
+
+ ASSERT(ecoreEvas);
+
+ ecore_evas_show(ecoreEvas);
+
+ return ecoreEvas;
+}
+
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+{
+ m_window = initEcoreEvas();
+ Evas* evas = ecore_evas_get(m_window);
+ m_view = toImpl(WKViewCreate(evas, contextRef, pageGroupRef));
+}
+
+PlatformWebView::~PlatformWebView()
+{
+ evas_object_del(m_view);
+ ecore_evas_free(m_window);
+ ecore_evas_shutdown();
+}
+
+WKPageRef PlatformWebView::page() const
+{
+ return WKViewGetPage(toAPI(m_view));
+}
+
+} // namespace TestWebKitAPI
Copied: trunk/Tools/TestWebKitAPI/efl/main.cpp (from rev 122972, trunk/Tools/TestWebKitAPI/config.h) (0 => 122973)
--- trunk/Tools/TestWebKitAPI/efl/main.cpp (rev 0)
+++ trunk/Tools/TestWebKitAPI/efl/main.cpp 2012-07-18 15:07:34 UTC (rev 122973)
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TestsController.h"
+#include <Ecore.h>
+#include <Eina.h>
+#include <getopt.h>
+
+bool useX11Window = false;
+
+static bool checkForUseX11WindowArgument(int argc, char** argv)
+{
+ int hasUseX11Window = 0;
+
+ static const option options[] = {
+ {"useX11Window", no_argument, &hasUseX11Window, 1},
+ {0, 0, 0, 0}
+ };
+
+ while (getopt_long(argc, argv, "", options, 0) != -1) { }
+
+ return hasUseX11Window;
+}
+
+int main(int argc, char** argv)
+{
+ if (!eina_init())
+ return EXIT_FAILURE;
+
+ if (!ecore_init())
+ return EXIT_FAILURE;
+
+ useX11Window = checkForUseX11WindowArgument(argc, argv);
+
+ int returnCode = TestWebKitAPI::TestsController::shared().run(argc, argv) ? EXIT_SUCCESS : EXIT_FAILURE;
+
+ ecore_shutdown();
+ eina_shutdown();
+
+ return returnCode;
+}