summaryrefslogtreecommitdiff
path: root/Tools/TestWebKitAPI
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/TestWebKitAPI')
-rw-r--r--Tools/TestWebKitAPI/CMakeLists.txt135
-rw-r--r--Tools/TestWebKitAPI/PlatformEfl.cmake91
-rw-r--r--Tools/TestWebKitAPI/PlatformWebView.h5
-rw-r--r--Tools/TestWebKitAPI/config.h6
-rw-r--r--Tools/TestWebKitAPI/efl/InjectedBundleController.cpp35
-rw-r--r--Tools/TestWebKitAPI/efl/PlatformUtilities.cpp69
-rw-r--r--Tools/TestWebKitAPI/efl/PlatformWebView.cpp76
-rw-r--r--Tools/TestWebKitAPI/efl/main.cpp65
8 files changed, 482 insertions, 0 deletions
diff --git a/Tools/TestWebKitAPI/CMakeLists.txt b/Tools/TestWebKitAPI/CMakeLists.txt
new file mode 100644
index 000000000..6c3a59d5c
--- /dev/null
+++ b/Tools/TestWebKitAPI/CMakeLists.txt
@@ -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
+ ${JAVASCRIPTCORE_DIR}
+ ${JAVASCRIPTCORE_DIR}/API
+ ${JAVASCRIPTCORE_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}/JavaScriptTest.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}
+ ${JavaScriptCore_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()
diff --git a/Tools/TestWebKitAPI/PlatformEfl.cmake b/Tools/TestWebKitAPI/PlatformEfl.cmake
new file mode 100644
index 000000000..4c4c90284
--- /dev/null
+++ b/Tools/TestWebKitAPI/PlatformEfl.cmake
@@ -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
diff --git a/Tools/TestWebKitAPI/PlatformWebView.h b/Tools/TestWebKitAPI/PlatformWebView.h
index cf0132e4a..653a17cca 100644
--- a/Tools/TestWebKitAPI/PlatformWebView.h
+++ b/Tools/TestWebKitAPI/PlatformWebView.h
@@ -46,6 +46,11 @@ typedef HWND PlatformWindow;
#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 {
diff --git a/Tools/TestWebKitAPI/config.h b/Tools/TestWebKitAPI/config.h
index 4ffcb8bc4..e3c2eb02d 100644
--- a/Tools/TestWebKitAPI/config.h
+++ b/Tools/TestWebKitAPI/config.h
@@ -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)
diff --git a/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp b/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp
new file mode 100644
index 000000000..5d55002cc
--- /dev/null
+++ b/Tools/TestWebKitAPI/efl/InjectedBundleController.cpp
@@ -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
diff --git a/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp b/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp
new file mode 100644
index 000000000..96745459f
--- /dev/null
+++ b/Tools/TestWebKitAPI/efl/PlatformUtilities.cpp
@@ -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
diff --git a/Tools/TestWebKitAPI/efl/PlatformWebView.cpp b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp
new file mode 100644
index 000000000..98c2a4a5e
--- /dev/null
+++ b/Tools/TestWebKitAPI/efl/PlatformWebView.cpp
@@ -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
diff --git a/Tools/TestWebKitAPI/efl/main.cpp b/Tools/TestWebKitAPI/efl/main.cpp
new file mode 100644
index 000000000..7c77dbfb2
--- /dev/null
+++ b/Tools/TestWebKitAPI/efl/main.cpp
@@ -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;
+}