summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-07 11:22:47 +0100
commitcfd86b747d32ac22246a1aa908eaa720c63a88c1 (patch)
tree24d68c6f61c464ecba1e05670b80390ea3b0e50c /Tools/WebKitTestRunner
parent69d7c744c9de19d152dbe2d8e46eb7dfd4511d1a (diff)
downloadqtwebkit-cfd86b747d32ac22246a1aa908eaa720c63a88c1.tar.gz
Imported WebKit commit 20271caf2e2c016d5cef40184cddeefeac4f1876 (http://svn.webkit.org/repository/webkit/trunk@133733)
New snapshot that contains all previous fixes as well as build fix for latest QtMultimedia API changes.
Diffstat (limited to 'Tools/WebKitTestRunner')
-rw-r--r--Tools/WebKitTestRunner/Configurations/Base.xcconfig18
-rw-r--r--Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig84
-rw-r--r--Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig13
-rw-r--r--Tools/WebKitTestRunner/EventSenderProxy.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp36
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/Target.pri3
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp14
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/TestRunner.h2
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm1
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm3
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp4
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp31
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h30
-rw-r--r--Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp10
-rw-r--r--Tools/WebKitTestRunner/PlatformEfl.cmake13
-rw-r--r--Tools/WebKitTestRunner/PlatformWebView.h10
-rw-r--r--Tools/WebKitTestRunner/Target.pri5
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp49
-rw-r--r--Tools/WebKitTestRunner/TestController.h8
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp46
-rw-r--r--Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj2
-rw-r--r--Tools/WebKitTestRunner/WorkQueueManager.cpp45
-rw-r--r--Tools/WebKitTestRunner/WorkQueueManager.h2
-rw-r--r--Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp35
-rw-r--r--Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp13
-rw-r--r--Tools/WebKitTestRunner/efl/main.cpp14
-rw-r--r--Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp4
-rw-r--r--Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp2
-rw-r--r--Tools/WebKitTestRunner/mac/EventSenderProxy.mm12
-rw-r--r--Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm42
-rw-r--r--Tools/WebKitTestRunner/mac/main.mm1
-rw-r--r--Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp9
-rw-r--r--Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp8
-rw-r--r--Tools/WebKitTestRunner/qt/main.cpp4
-rw-r--r--Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp2
37 files changed, 331 insertions, 250 deletions
diff --git a/Tools/WebKitTestRunner/Configurations/Base.xcconfig b/Tools/WebKitTestRunner/Configurations/Base.xcconfig
index 512104b17..ef87ffe66 100644
--- a/Tools/WebKitTestRunner/Configurations/Base.xcconfig
+++ b/Tools/WebKitTestRunner/Configurations/Base.xcconfig
@@ -21,8 +21,8 @@
// (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 "CompilerVersion.xcconfig"
-
+CLANG_CXX_LANGUAGE_STANDARD = gnu++0x;
+CLANG_CXX_LIBRARY = libc++;
CLANG_WARN_CXX0X_EXTENSIONS = NO;
HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders ${SRCROOT}/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport;
FRAMEWORK_SEARCH_PATHS = $(SYSTEM_LIBRARY_DIR)/Frameworks/Quartz.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/ApplicationServices.framework/Frameworks $(SYSTEM_LIBRARY_DIR)/Frameworks/CoreServices.framework/Frameworks;
@@ -34,6 +34,7 @@ GCC_ENABLE_CPP_EXCEPTIONS = NO;
GCC_ENABLE_CPP_RTTI = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES
GCC_TREAT_WARNINGS_AS_ERRORS = YES
+GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = NO
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES
@@ -46,22 +47,9 @@ DEBUG_DEFINES_debug = ;
DEBUG_DEFINES_normal = NDEBUG;
DEBUG_DEFINES = $(DEBUG_DEFINES_$(CURRENT_VARIANT));
-CLANG_CXX_LIBRARY = $(CLANG_CXX_LIBRARY_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-CLANG_CXX_LIBRARY_1060 = libstdc++;
-CLANG_CXX_LIBRARY_1070 = libc++;
-CLANG_CXX_LIBRARY_1080 = libc++;
-CLANG_CXX_LIBRARY_1090 = libc++;
-
-REAL_PLATFORM_NAME = $(REAL_PLATFORM_NAME_$(PLATFORM_NAME));
-REAL_PLATFORM_NAME_ = $(REAL_PLATFORM_NAME_macosx);
-REAL_PLATFORM_NAME_iphoneos = iphoneos;
-REAL_PLATFORM_NAME_iphonesimulator = iphonesimulator;
-REAL_PLATFORM_NAME_macosx = macosx;
-
TARGET_MAC_OS_X_VERSION_MAJOR = $(MAC_OS_X_VERSION_MAJOR);
TARGETING_SAME_OS_X_VERSION = $(TARGETING_SAME_OS_X_VERSION_$(MAC_OS_X_VERSION_MAJOR)_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-TARGETING_SAME_OS_X_VERSION_1060_1060 = YES;
TARGETING_SAME_OS_X_VERSION_1070_1070 = YES;
TARGETING_SAME_OS_X_VERSION_1080_1080 = YES;
TARGETING_SAME_OS_X_VERSION_1090_1090 = YES;
diff --git a/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig b/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig
deleted file mode 100644
index a8c7f75a0..000000000
--- a/Tools/WebKitTestRunner/Configurations/CompilerVersion.xcconfig
+++ /dev/null
@@ -1,84 +0,0 @@
-// Copyright (C) 2009, 2010, 2011 Apple Inc. 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. ``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
-// 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.
-
-IS_XCODE_0400 = $(IS_XCODE_0400_$(XCODE_VERSION_MINOR));
-IS_XCODE_0400_0400 = YES;
-
-IS_XCODE_0400_OR_0410 = $(IS_XCODE_0400_OR_0410_$(XCODE_VERSION_MINOR));
-IS_XCODE_0400_OR_0410_0400 = YES;
-IS_XCODE_0400_OR_0410_0410 = YES;
-
-// The version of the LLVM Compiler in Xcode 4.0 and earlier have difficulty compiling our code.
-LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_$(XCODE_VERSION_MAJOR));
-LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0300 = YES;
-LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_$(IS_XCODE_0400));
-LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS_IS_XCODE_0400_YES = YES;
-
-// The version of the LLVM Compiler in Xcode 4.1 and earlier do not generate fast enough code.
-LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_$(XCODE_VERSION_MAJOR));
-LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0300 = YES;
-LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_0400 = $(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_$(IS_XCODE_0400_OR_0410));
-LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS_IS_XCODE_0400_OR_0410_YES = YES;
-
-LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_DEBUG_BUILDS));
-LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_ = YES;
-LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS_YES = NO;
-
-LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS = $(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_$(LLVM_COMPILER_UNSUITABLE_FOR_OPTIMIZED_BUILDS));
-LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_ = YES;
-LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS_YES = NO;
-
-
-// Use GCC 4.2 with Xcode 3.1, which includes GCC 4.2 but defaults to GCC 4.0.
-// Note that Xcode versions as new as 3.1.2 use XCODE_VERSION_ACTUAL for the minor version
-// number. Newer versions of Xcode use XCODE_VERSION_MINOR for the minor version, and
-// XCODE_VERSION_ACTUAL for the full version number.
-TARGET_GCC_VERSION = $(TARGET_GCC_VERSION_$(REAL_PLATFORM_NAME));
-TARGET_GCC_VERSION_iphoneos = LLVM_GCC_42;
-TARGET_GCC_VERSION_iphonesimulator = GCC_42;
-TARGET_GCC_VERSION_macosx = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-
-TARGET_GCC_VERSION_macosx_1050 = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_MINOR));
-TARGET_GCC_VERSION_macosx_1050_ = $(TARGET_GCC_VERSION_macosx_1050_$(XCODE_VERSION_ACTUAL));
-TARGET_GCC_VERSION_macosx_1050_0310 = GCC_42;
-TARGET_GCC_VERSION_macosx_1050_0320 = GCC_42;
-
-TARGET_GCC_VERSION_macosx_1060 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION));
-TARGET_GCC_VERSION_macosx_1070 = $(TARGET_GCC_VERSION_macosx_1060_AND_1070_$(CONFIGURATION));
-TARGET_GCC_VERSION_macosx_1060_AND_1070_Debug = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_DEBUG_BUILDS));
-TARGET_GCC_VERSION_macosx_1060_AND_1070_Release = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS));
-TARGET_GCC_VERSION_macosx_1060_AND_1070_Production = $(TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_$(LLVM_COMPILER_SUITABLE_FOR_OPTIMIZED_BUILDS));
-TARGET_GCC_VERSION_macosx_1060_NON_LLVM_FALLBACK = GCC_42;
-TARGET_GCC_VERSION_macosx_1070_NON_LLVM_FALLBACK = LLVM_GCC_42;
-
-TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_YES = LLVM_COMPILER;
-TARGET_GCC_VERSION_macosx_USE_LLVM_COMPILER_NO = $(TARGET_GCC_VERSION_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR)_NON_LLVM_FALLBACK);
-
-TARGET_GCC_VERSION_macosx_1080 = LLVM_COMPILER;
-TARGET_GCC_VERSION_macosx_1090 = LLVM_COMPILER;
-
-GCC_VERSION = $(GCC_VERSION_$(TARGET_GCC_VERSION));
-GCC_VERSION_GCC_40 = 4.0;
-GCC_VERSION_GCC_42 = 4.2;
-GCC_VERSION_LLVM_GCC_42 = com.apple.compilers.llvmgcc42;
-GCC_VERSION_LLVM_COMPILER = com.apple.compilers.llvm.clang.1_0;
diff --git a/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig b/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
index 1f5144554..5b97d1272 100644
--- a/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
+++ b/Tools/WebKitTestRunner/Configurations/DebugRelease.xcconfig
@@ -23,30 +23,21 @@
#include "Base.xcconfig"
-ARCHS = $(ARCHS_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-ARCHS_1050 = $(NATIVE_ARCH);
-ARCHS_1060 = $(ARCHS_STANDARD_32_64_BIT);
-ARCHS_1070 = $(ARCHS_STANDARD_32_64_BIT);
-ARCHS_1080 = $(ARCHS_STANDARD_32_64_BIT);
-ARCHS_1090 = $(ARCHS_STANDARD_32_64_BIT);
+ARCHS = $(ARCHS_STANDARD_32_64_BIT);
ONLY_ACTIVE_ARCH = YES;
MACOSX_DEPLOYMENT_TARGET = $(MACOSX_DEPLOYMENT_TARGET_$(TARGET_MAC_OS_X_VERSION_MAJOR))
-MACOSX_DEPLOYMENT_TARGET_1050 = 10.5;
-MACOSX_DEPLOYMENT_TARGET_1060 = 10.6;
MACOSX_DEPLOYMENT_TARGET_1070 = 10.7;
MACOSX_DEPLOYMENT_TARGET_1080 = 10.8;
MACOSX_DEPLOYMENT_TARGET_1090 = 10.9;
WEBKIT_UMBRELLA_FRAMEWORKS_DIR = $(BUILT_PRODUCTS_DIR);
-WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(REAL_PLATFORM_NAME));
+WEBKIT_SYSTEM_INTERFACE_LIBRARY = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_$(PLATFORM_NAME));
WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos = WebKitSystemInterface;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphonesimulator = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_iphoneos);
WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx = $(WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_$(TARGET_MAC_OS_X_VERSION_MAJOR));
-WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1050 = WebKitSystemInterfaceLeopard;
-WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1060 = WebKitSystemInterfaceSnowLeopard;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1070 = WebKitSystemInterfaceLion;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1080 = WebKitSystemInterfaceMountainLion;
WEBKIT_SYSTEM_INTERFACE_LIBRARY_macosx_1090 = WebKitSystemInterfaceMountainLion;
diff --git a/Tools/WebKitTestRunner/EventSenderProxy.h b/Tools/WebKitTestRunner/EventSenderProxy.h
index ce2c1a612..92fe2d077 100644
--- a/Tools/WebKitTestRunner/EventSenderProxy.h
+++ b/Tools/WebKitTestRunner/EventSenderProxy.h
@@ -127,7 +127,7 @@ private:
#endif
#elif PLATFORM(EFL)
Deque<WTREvent> m_eventQueue;
- unsigned m_mouseButton;
+ WKEventMouseButton m_mouseButton;
#if ENABLE(TOUCH_EVENTS)
Eina_List* m_touchPoints;
#endif
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
index f9f619981..6dad1b2bd 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
+++ b/Tools/WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl
@@ -184,7 +184,9 @@ interface TestRunner {
// Work queue.
void queueBackNavigation(in unsigned long howFarBackward);
+ void queueForwardNavigation(in unsigned long howFarForward);
void queueLoad(in DOMString url, in DOMString target);
+ void queueLoadHTMLString(in DOMString content, in [Optional] DOMString baseURL, in [Optional] DOMString unreachableURL);
void queueReload();
void queueLoadingScript(in DOMString script);
void queueNonLoadingScript(in DOMString script);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
index d64a734f0..9a5e8075c 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
@@ -253,6 +253,7 @@ void InjectedBundle::beginTesting(WKDictionaryRef settings)
WKBundleSetPopupBlockingEnabled(m_bundle, m_pageGroup, false);
WKBundleSetAlwaysAcceptCookies(m_bundle, false);
WKBundleSetSerialLoadingEnabled(m_bundle, false);
+ WKBundleSetShadowDOMEnabled(m_bundle, true);
WKBundleRemoveAllUserContent(m_bundle, m_pageGroup);
@@ -479,7 +480,16 @@ void InjectedBundle::queueBackNavigation(unsigned howFarBackward)
WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueBackNavigation"));
WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarBackward));
- WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
+}
+
+void InjectedBundle::queueForwardNavigation(unsigned howFarForward)
+{
+ m_useWorkQueue = true;
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueForwardNavigation"));
+ WKRetainPtr<WKUInt64Ref> messageBody(AdoptWK, WKUInt64Create(howFarForward));
+ WKBundlePostMessage(m_bundle, messageName.get(), messageBody.get());
}
void InjectedBundle::queueLoad(WKStringRef url, WKStringRef target)
@@ -499,6 +509,30 @@ void InjectedBundle::queueLoad(WKStringRef url, WKStringRef target)
WKBundlePostMessage(m_bundle, messageName.get(), loadData.get());
}
+void InjectedBundle::queueLoadHTMLString(WKStringRef content, WKStringRef baseURL, WKStringRef unreachableURL)
+{
+ m_useWorkQueue = true;
+
+ WKRetainPtr<WKStringRef> messageName(AdoptWK, WKStringCreateWithUTF8CString("QueueLoadHTMLString"));
+
+ WKRetainPtr<WKMutableDictionaryRef> loadData(AdoptWK, WKMutableDictionaryCreate());
+
+ WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content"));
+ WKDictionaryAddItem(loadData.get(), contentKey.get(), content);
+
+ if (baseURL) {
+ WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL"));
+ WKDictionaryAddItem(loadData.get(), baseURLKey.get(), baseURL);
+ }
+
+ if (unreachableURL) {
+ WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL"));
+ WKDictionaryAddItem(loadData.get(), unreachableURLKey.get(), unreachableURL);
+ }
+
+ WKBundlePostMessage(m_bundle, messageName.get(), loadData.get());
+}
+
void InjectedBundle::queueReload()
{
m_useWorkQueue = true;
diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
index f3d2034ef..41469ec79 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
@@ -102,7 +102,9 @@ public:
bool shouldProcessWorkQueue() const;
void processWorkQueue();
void queueBackNavigation(unsigned howFarBackward);
+ void queueForwardNavigation(unsigned howFarForward);
void queueLoad(WKStringRef url, WKStringRef target);
+ void queueLoadHTMLString(WKStringRef content, WKStringRef baseURL = 0, WKStringRef unreachableURL = 0);
void queueReload();
void queueLoadingScript(WKStringRef script);
void queueNonLoadingScript(WKStringRef script);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
index a46b9300d..d7305e3ac 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri
+++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri
@@ -28,7 +28,6 @@ SOURCES += \
Bindings/JSWrapper.cpp \
qt/ActivateFontsQt.cpp \
qt/InjectedBundleQt.cpp \
- qt/QtInitializeTestFonts.cpp \
qt/TestRunnerQt.cpp
# Adds the generated sources to SOURCES
@@ -46,7 +45,6 @@ HEADERS += \
InjectedBundlePage.h \
TestRunner.h \
TextInputController.h \
- qt/QtInitializeTestFonts.h
DESTDIR = $${ROOT_BUILD_DIR}/lib
@@ -62,6 +60,7 @@ INCLUDEPATH += \
$$PWD \
$$PWD/.. \
$$PWD/Bindings \
+ $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \
$${ROOT_WEBKIT_DIR}/Source/WebCore/testing/js \
$${ROOT_WEBKIT_DIR}/Source/WebKit/qt/WebCoreSupport
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
index 23b5f34f2..a294da7d4 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.cpp
@@ -839,6 +839,11 @@ void TestRunner::queueBackNavigation(unsigned howFarBackward)
InjectedBundle::shared().queueBackNavigation(howFarBackward);
}
+void TestRunner::queueForwardNavigation(unsigned howFarForward)
+{
+ InjectedBundle::shared().queueForwardNavigation(howFarForward);
+}
+
void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
{
WKRetainPtr<WKURLRef> baseURLWK(AdoptWK, WKBundleFrameCopyURL(WKBundlePageGetMainFrame(InjectedBundle::shared().page()->page())));
@@ -848,6 +853,15 @@ void TestRunner::queueLoad(JSStringRef url, JSStringRef target)
InjectedBundle::shared().queueLoad(urlStringWK.get(), toWK(target).get());
}
+void TestRunner::queueLoadHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL)
+{
+ WKRetainPtr<WKStringRef> contentWK = toWK(content);
+ WKRetainPtr<WKStringRef> baseURLWK = baseURL ? toWK(baseURL) : WKRetainPtr<WKStringRef>();
+ WKRetainPtr<WKStringRef> unreachableURLWK = unreachableURL ? toWK(unreachableURL) : WKRetainPtr<WKStringRef>();
+
+ InjectedBundle::shared().queueLoadHTMLString(contentWK.get(), baseURLWK.get(), unreachableURLWK.get());
+}
+
void TestRunner::queueReload()
{
InjectedBundle::shared().queueReload();
diff --git a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
index f92e34220..48b922c49 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
+++ b/Tools/WebKitTestRunner/InjectedBundle/TestRunner.h
@@ -263,7 +263,9 @@ public:
// Work queue.
void queueBackNavigation(unsigned howFarBackward);
+ void queueForwardNavigation(unsigned howFarForward);
void queueLoad(JSStringRef url, JSStringRef target);
+ void queueLoadHTMLString(JSStringRef content, JSStringRef baseURL, JSStringRef unreachableURL);
void queueReload();
void queueLoadingScript(JSStringRef script);
void queueNonLoadingScript(JSStringRef script);
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm
index c49171a8c..f13dd9dab 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm
+++ b/Tools/WebKitTestRunner/InjectedBundle/mac/ActivateFonts.mm
@@ -141,6 +141,7 @@ static NSSet *allowedFontFamilySet()
@"STFangsong",
@"STHeiti",
@"STIXGeneral",
+ @"STIXSizeOneSym",
@"STKaiti",
@"STSong",
@"Symbol",
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm
index 46c273f1f..b0cb4e031 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm
+++ b/Tools/WebKitTestRunner/InjectedBundle/mac/InjectedBundlePageMac.mm
@@ -85,8 +85,7 @@ void InjectedBundlePage::platformDidStartProvisionalLoadForFrame(WKBundleFrameRe
StringBuilder builder;
builder.appendLiteral("CRASHING TEST: ");
builder.append(testPath);
- RetainPtr<CFStringRef> cfString(AdoptCF, builder.toString().createCFString());
- WKSetCrashReportApplicationSpecificInformation(cfString.get());
+ WKSetCrashReportApplicationSpecificInformation(builder.toString().createCFString().get());
}
#endif
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
index 789e2177f..332ffcf02 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/ActivateFontsQt.cpp
@@ -30,14 +30,14 @@
#include "config.h"
#include "ActivateFonts.h"
#include "DumpRenderTreeSupportQt.h"
-#include "QtInitializeTestFonts.h"
+#include "QtTestSupport.h"
#include <QCoreApplication>
namespace WTR {
void activateFonts()
{
- WebKit::initializeTestFonts();
+ WebKit::QtTestSupport::initializeTestFonts();
QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp
deleted file mode 100644
index fcacf9778..000000000
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "../../../DumpRenderTree/qt/QtInitializeTestFonts.cpp"
-
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h b/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h
deleted file mode 100644
index 87fa87bfa..000000000
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/QtInitializeTestFonts.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies)
- *
- * 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "../../../DumpRenderTree/qt/QtInitializeTestFonts.h"
-
diff --git a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp
index f5d149b3d..1671ac73b 100644
--- a/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp
+++ b/Tools/WebKitTestRunner/InjectedBundle/qt/TestRunnerQt.cpp
@@ -29,10 +29,12 @@
#include "ActivateFonts.h"
#include "InjectedBundle.h"
+#include "QtTestSupport.h"
#include <QCoreApplication>
#include <QDir>
#include <QFontDatabase>
#include <QObject>
+#include <QtCore/qglobal.h>
#include <qwebsettings.h>
namespace WTR {
@@ -59,13 +61,9 @@ private:
void TestRunner::platformInitialize()
{
- // Make WebKit2 mimic the behaviour of DumpRenderTree, which is incorrect,
- // but tests are successfully passed. On the long run, Qt will move to QRawFont,
- // which makes the use of QFontDatabase unnecessary.
- // See https://bugs.webkit.org/show_bug.cgi?id=53427
- QWebSettings::clearMemoryCaches();
- QFontDatabase::removeAllApplicationFonts();
+ WebKit::QtTestSupport::clearMemoryCaches();
activateFonts();
+
QObject::connect(&m_waitToDumpWatchdogTimer, SIGNAL(timeout()), WatchdogTimerHelper::instance(), SLOT(timerFired()));
}
diff --git a/Tools/WebKitTestRunner/PlatformEfl.cmake b/Tools/WebKitTestRunner/PlatformEfl.cmake
index 4ab8966d2..1c6947258 100644
--- a/Tools/WebKitTestRunner/PlatformEfl.cmake
+++ b/Tools/WebKitTestRunner/PlatformEfl.cmake
@@ -25,7 +25,6 @@ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES
${CAIRO_INCLUDE_DIRS}
${ECORE_INCLUDE_DIRS}
${ECORE_EVAS_INCLUDE_DIRS}
- ${ECORE_X_INCLUDE_DIRS}
${EINA_INCLUDE_DIRS}
${EVAS_INCLUDE_DIRS}
${GLIB_INCLUDE_DIRS}
@@ -35,7 +34,6 @@ LIST(APPEND WebKitTestRunner_LIBRARIES
${CAIRO_LIBRARIES}
${ECORE_LIBRARIES}
${ECORE_EVAS_LIBRARIES}
- ${ECORE_X_LIBRARIES}
${EINA_LIBRARIES}
${EVAS_LIBRARIES}
${GLIB_LIBRARIES}
@@ -43,6 +41,17 @@ LIST(APPEND WebKitTestRunner_LIBRARIES
${WTF_LIBRARY_NAME}
)
+IF (ENABLE_ECORE_X)
+ LIST(APPEND WebKitTestRunner_INCLUDE_DIRECTORIES
+ ${ECORE_X_INCLUDE_DIRS}
+ )
+
+ LIST(APPEND WebKitTestRunner_LIBRARIES
+ ${ECORE_X_LIBRARIES}
+ ${X11_Xext_LIB}
+ )
+ENDIF ()
+
LIST(APPEND WebKitTestRunnerInjectedBundle_SOURCES
${TOOLS_DIR}/DumpRenderTree/efl/FontManagement.cpp
diff --git a/Tools/WebKitTestRunner/PlatformWebView.h b/Tools/WebKitTestRunner/PlatformWebView.h
index 13859e143..60d2fc1d5 100644
--- a/Tools/WebKitTestRunner/PlatformWebView.h
+++ b/Tools/WebKitTestRunner/PlatformWebView.h
@@ -64,7 +64,7 @@ namespace WTR {
class PlatformWebView {
public:
- PlatformWebView(WKContextRef, WKPageGroupRef);
+ PlatformWebView(WKContextRef, WKPageGroupRef, WKDictionaryRef options = 0);
~PlatformWebView();
WKPageRef page();
@@ -88,7 +88,13 @@ public:
void makeWebViewFirstResponder();
void setWindowIsKey(bool isKey) { m_windowIsKey = isKey; }
bool windowIsKey() const { return m_windowIsKey; }
-
+
+#if PLATFORM(MAC)
+ bool viewSupportsOptions(WKDictionaryRef) const;
+#else
+ bool viewSupportsOptions(WKDictionaryRef) const { return true; }
+#endif
+
WKRetainPtr<WKImageRef> windowSnapshotImage();
private:
diff --git a/Tools/WebKitTestRunner/Target.pri b/Tools/WebKitTestRunner/Target.pri
index 120a027ce..39800ab8d 100644
--- a/Tools/WebKitTestRunner/Target.pri
+++ b/Tools/WebKitTestRunner/Target.pri
@@ -8,7 +8,6 @@ TEMPLATE = app
TARGET = WebKitTestRunner
HEADERS += \
- $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.h \
EventSenderProxy.h \
GeolocationProviderMock.h \
PlatformWebView.h \
@@ -19,7 +18,6 @@ HEADERS += \
WorkQueueManager.h
SOURCES += \
- $${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt/QtInitializeTestFonts.cpp \
qt/main.cpp \
qt/EventSenderProxyQt.cpp \
qt/PlatformWebViewQt.cpp \
@@ -39,10 +37,9 @@ WEBKIT += wtf javascriptcore webkit2
DEFINES += USE_SYSTEM_MALLOC=1
-have?(FONTCONFIG): PKGCONFIG += fontconfig
-
INCLUDEPATH += \
$$PWD \
+ $${ROOT_WEBKIT_DIR}/Source/WebCore/platform/qt \
$${ROOT_WEBKIT_DIR}/Tools/DumpRenderTree/qt
PREFIX_HEADER = WebKitTestRunnerPrefix.h
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index e9ef0471d..07ff81bb7 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -81,6 +81,7 @@ TestController::TestController(int argc, const char* argv[])
, m_printSeparators(false)
, m_usingServerMode(false)
, m_gcBetweenTests(false)
+ , m_shouldDumpPixelsForAllTests(false)
, m_state(Initial)
, m_doneResetting(false)
, m_longTimeout(defaultLongTimeout)
@@ -95,9 +96,6 @@ TestController::TestController(int argc, const char* argv[])
, m_isGeolocationPermissionAllowed(false)
, m_policyDelegateEnabled(false)
, m_policyDelegatePermissive(false)
-#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
- , m_eventSenderProxy(new EventSenderProxy(this))
-#endif
{
initialize(argc, argv);
controller = this;
@@ -283,11 +281,16 @@ void TestController::initialize(int argc, const char* argv[])
m_gcBetweenTests = true;
continue;
}
+ if (argument == "--pixel-tests" || argument == "-p") {
+ m_shouldDumpPixelsForAllTests = true;
+ continue;
+ }
if (argument == "--print-supported-features") {
printSupportedFeatures = true;
break;
}
+
// Skip any other arguments that begin with '--'.
if (argument.length() >= 2 && argument[0] == '-' && argument[1] == '-')
continue;
@@ -323,6 +326,18 @@ void TestController::initialize(int argc, const char* argv[])
WKContextSetLocalStorageDirectory(m_context.get(), dumpRenderTreeTempWK.get());
WKContextSetDiskCacheDirectory(m_context.get(), dumpRenderTreeTempWK.get());
WKContextSetCookieStorageDirectory(m_context.get(), dumpRenderTreeTempWK.get());
+
+ std::string iconDatabaseFileTemp(dumpRenderTreeTemp);
+ // WebCore::pathByAppendingComponent is not used here because of the namespace,
+ // which leads us to this ugly #ifdef and file path concatenation.
+#if OS(WINDOWS)
+ const char separator = '\\';
+#else
+ const char separator = '/';
+#endif
+ iconDatabaseFileTemp = iconDatabaseFileTemp + separator + "WebpageIcons.db";
+ WKRetainPtr<WKStringRef> iconDatabaseFileTempWK = WKStringCreateWithUTF8CString(iconDatabaseFileTemp.c_str());
+ WKContextSetIconDatabasePath(m_context.get(), iconDatabaseFileTempWK.get());
}
platformInitializeContext();
@@ -343,8 +358,12 @@ void TestController::initialize(int argc, const char* argv[])
if (testPluginDirectory())
WKContextSetAdditionalPluginsDirectory(m_context.get(), testPluginDirectory());
- m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get()));
+ createWebViewWithOptions(0);
+}
+void TestController::createWebViewWithOptions(WKDictionaryRef options)
+{
+ m_mainWebView = adoptPtr(new PlatformWebView(m_context.get(), m_pageGroup.get(), options));
WKPageUIClient pageUIClient = {
kWKPageUIClientCurrentVersion,
m_mainWebView.get(),
@@ -446,6 +465,21 @@ void TestController::initialize(int argc, const char* argv[])
WKPageSetPagePolicyClient(m_mainWebView->page(), &pagePolicyClient);
}
+void TestController::ensureViewSupportsOptions(WKDictionaryRef options)
+{
+ if (m_mainWebView && !m_mainWebView->viewSupportsOptions(options)) {
+ WKPageSetPageUIClient(m_mainWebView->page(), 0);
+ WKPageSetPageLoaderClient(m_mainWebView->page(), 0);
+ WKPageSetPagePolicyClient(m_mainWebView->page(), 0);
+ WKPageClose(m_mainWebView->page());
+
+ m_mainWebView = nullptr;
+
+ createWebViewWithOptions(options);
+ resetStateToConsistentValues();
+ }
+}
+
bool TestController::resetStateToConsistentValues()
{
m_state = Resetting;
@@ -467,6 +501,11 @@ bool TestController::resetStateToConsistentValues()
// FIXME: This function should also ensure that there is only one page open.
+ // Reset the EventSender for each test.
+#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
+ m_eventSenderProxy = adoptPtr(new EventSenderProxy(this));
+#endif
+
// Reset preferences
WKPreferencesRef preferences = WKPageGroupGetPreferences(m_pageGroup.get());
WKPreferencesResetTestRunnerOverrides(preferences);
@@ -629,7 +668,7 @@ bool TestController::runTest(const char* inputLine)
m_state = RunningTest;
m_currentInvocation = adoptPtr(new TestInvocation(command.pathOrURL));
- if (command.shouldDumpPixels)
+ if (command.shouldDumpPixels || m_shouldDumpPixelsForAllTests)
m_currentInvocation->setIsPixelTest(command.expectedPixelHash);
m_currentInvocation->invoke();
diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h
index 7081acdaa..56c3c4702 100644
--- a/Tools/WebKitTestRunner/TestController.h
+++ b/Tools/WebKitTestRunner/TestController.h
@@ -57,6 +57,8 @@ public:
PlatformWebView* mainWebView() { return m_mainWebView.get(); }
WKContextRef context() { return m_context.get(); }
+ void ensureViewSupportsOptions(WKDictionaryRef options);
+
// Runs the run loop until `done` is true or the timeout elapses.
enum TimeoutDuration { ShortTimeout, LongTimeout, NoTimeout };
bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; }
@@ -83,6 +85,7 @@ public:
private:
void initialize(int argc, const char* argv[]);
+ void createWebViewWithOptions(WKDictionaryRef);
void run();
void runTestingServerLoop();
@@ -137,6 +140,7 @@ private:
bool m_printSeparators;
bool m_usingServerMode;
bool m_gcBetweenTests;
+ bool m_shouldDumpPixelsForAllTests;
std::vector<std::string> m_paths;
WKRetainPtr<WKStringRef> m_injectedBundlePath;
WKRetainPtr<WKStringRef> m_testPluginDirectory;
@@ -174,7 +178,9 @@ private:
bool m_policyDelegateEnabled;
bool m_policyDelegatePermissive;
- EventSenderProxy* m_eventSenderProxy;
+#if PLATFORM(MAC) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL)
+ OwnPtr<EventSenderProxy> m_eventSenderProxy;
+#endif
WorkQueueManager m_workQueueManager;
};
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index fd9423220..1cb56bb71 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -143,9 +143,31 @@ static bool shouldOpenWebInspector(const char* pathOrURL)
}
#endif
+#if PLATFORM(MAC)
+static bool shouldUseTiledDrawing(const char* pathOrURL)
+{
+ return strstr(pathOrURL, "tiled-drawing/") || strstr(pathOrURL, "tiled-drawing\\");
+}
+#endif
+
+static void updateTiledDrawingForCurrentTest(const char* pathOrURL)
+{
+#if PLATFORM(MAC)
+ WKRetainPtr<WKMutableDictionaryRef> viewOptions = adoptWK(WKMutableDictionaryCreate());
+ WKRetainPtr<WKStringRef> useTiledDrawingKey = adoptWK(WKStringCreateWithUTF8CString("TiledDrawing"));
+ WKRetainPtr<WKBooleanRef> useTiledDrawingValue = adoptWK(WKBooleanCreate(shouldUseTiledDrawing(pathOrURL)));
+ WKDictionaryAddItem(viewOptions.get(), useTiledDrawingKey.get(), useTiledDrawingValue.get());
+
+ TestController::shared().ensureViewSupportsOptions(viewOptions.get());
+#else
+ UNUSED_PARAM(pathOrURL);
+#endif
+}
+
void TestInvocation::invoke()
{
sizeWebViewForCurrentTest(m_pathOrURL.c_str());
+ updateTiledDrawingForCurrentTest(m_pathOrURL.c_str());
WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest"));
WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate());
@@ -447,6 +469,13 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
return;
}
+ if (WKStringIsEqualToUTF8CString(messageName, "QueueForwardNavigation")) {
+ ASSERT(WKGetTypeID(messageBody) == WKUInt64GetTypeID());
+ uint64_t stepCount = WKUInt64GetValue(static_cast<WKUInt64Ref>(messageBody));
+ TestController::shared().workQueueManager().queueForwardNavigation(stepCount);
+ return;
+ }
+
if (WKStringIsEqualToUTF8CString(messageName, "QueueLoad")) {
ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody);
@@ -461,6 +490,23 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
return;
}
+ if (WKStringIsEqualToUTF8CString(messageName, "QueueLoadHTMLString")) {
+ ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID());
+ WKDictionaryRef loadDataDictionary = static_cast<WKDictionaryRef>(messageBody);
+
+ WKRetainPtr<WKStringRef> contentKey(AdoptWK, WKStringCreateWithUTF8CString("content"));
+ WKStringRef contentWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, contentKey.get()));
+
+ WKRetainPtr<WKStringRef> baseURLKey(AdoptWK, WKStringCreateWithUTF8CString("baseURL"));
+ WKStringRef baseURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, baseURLKey.get()));
+
+ WKRetainPtr<WKStringRef> unreachableURLKey(AdoptWK, WKStringCreateWithUTF8CString("unreachableURL"));
+ WKStringRef unreachableURLWK = static_cast<WKStringRef>(WKDictionaryGetItemForKey(loadDataDictionary, unreachableURLKey.get()));
+
+ TestController::shared().workQueueManager().queueLoadHTMLString(toWTFString(contentWK), baseURLWK ? toWTFString(baseURLWK) : String(), unreachableURLWK ? toWTFString(unreachableURLWK) : String());
+ return;
+ }
+
if (WKStringIsEqualToUTF8CString(messageName, "QueueReload")) {
TestController::shared().workQueueManager().queueReload();
return;
diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
index 75ce94e63..530347b39 100644
--- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
+++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
@@ -570,7 +570,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\n\nexport WebKitTestRunner=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n case $TARGET_GCC_VERSION in\n (GCC_42)\n export CC=\"`xcrun -find gcc-4.2`\";;\n (LLVM_GCC_42)\n export CC=\"`xcrun -find llvm-gcc-4.2`\";;\n (LLVM_COMPILER)\n export CC=\"`xcrun -find clang`\";;\n esac\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -f \"${WebKitTestRunner}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n";
+ shellScript = "mkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebKitTestRunner\"\n\nexport WebKitTestRunner=\"${SRCROOT}\"\nexport WebCoreScripts=\"${WEBCORE_PRIVATE_HEADERS_DIR}\"\n\nif [ ! $CC ]; then\n export CC=\"`xcrun -find clang`\"\nfi\n\nif [ \"${ACTION}\" = \"build\" -o \"${ACTION}\" = \"install\" -o \"${ACTION}\" = \"installhdrs\" ]; then\n make -f \"${WebKitTestRunner}/DerivedSources.make\" -j `/usr/sbin/sysctl -n hw.availcpu`\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
diff --git a/Tools/WebKitTestRunner/WorkQueueManager.cpp b/Tools/WebKitTestRunner/WorkQueueManager.cpp
index 738357908..84792303f 100644
--- a/Tools/WebKitTestRunner/WorkQueueManager.cpp
+++ b/Tools/WebKitTestRunner/WorkQueueManager.cpp
@@ -87,6 +87,18 @@ public:
WKRetainPtr<WKStringRef> m_script;
};
+class NavigationItem : public WorkQueueItem {
+public:
+ explicit NavigationItem(int index) : m_index(index) { }
+
+ WorkQueueItem::Type invoke() const
+ {
+ return goToItemAtIndex(m_index) ? WorkQueueItem::Loading : WorkQueueItem::NonLoading;
+ }
+
+ unsigned m_index;
+};
+
WorkQueueManager::WorkQueueManager()
: m_processing(false)
{
@@ -141,18 +153,39 @@ void WorkQueueManager::queueLoad(const String& url, const String& target)
enqueue(new LoadItem(url, target));
}
-void WorkQueueManager::queueBackNavigation(unsigned howFarBackward)
+void WorkQueueManager::queueLoadHTMLString(const String& content, const String& baseURL, const String& unreachableURL)
{
- class BackNavigationItem : public WorkQueueItem {
+ class LoadHTMLStringItem : public WorkQueueItem {
public:
- explicit BackNavigationItem(unsigned howFarBackward) : m_howFarBackward(howFarBackward) { }
+ LoadHTMLStringItem(const String& content, const String& baseURL, const String& unreachableURL)
+ : m_content(AdoptWK, WKStringCreateWithUTF8CString(content.utf8().data()))
+ , m_baseURL(AdoptWK, WKURLCreateWithUTF8CString(baseURL.utf8().data()))
+ , m_unreachableURL(AdoptWK, WKURLCreateWithUTF8CString(unreachableURL.utf8().data()))
+ {
+ }
- WorkQueueItem::Type invoke() const { return goToItemAtIndex(-m_howFarBackward) ? WorkQueueItem::Loading : WorkQueueItem::NonLoading; }
+ WorkQueueItem::Type invoke() const
+ {
+ WKPageLoadAlternateHTMLString(mainPage(), m_content.get(), m_baseURL.get(), m_unreachableURL.get());
+ return WorkQueueItem::Loading;
+ }
- unsigned m_howFarBackward;
+ WKRetainPtr<WKStringRef> m_content;
+ WKRetainPtr<WKURLRef> m_baseURL;
+ WKRetainPtr<WKURLRef> m_unreachableURL;
};
- enqueue(new BackNavigationItem(howFarBackward));
+ enqueue(new LoadHTMLStringItem(content, baseURL, unreachableURL));
+}
+
+void WorkQueueManager::queueBackNavigation(unsigned howFarBackward)
+{
+ enqueue(new NavigationItem(-howFarBackward));
+}
+
+void WorkQueueManager::queueForwardNavigation(unsigned howFarForward)
+{
+ enqueue(new NavigationItem(howFarForward));
}
void WorkQueueManager::queueReload()
diff --git a/Tools/WebKitTestRunner/WorkQueueManager.h b/Tools/WebKitTestRunner/WorkQueueManager.h
index b9a22dde3..21d5ebb88 100644
--- a/Tools/WebKitTestRunner/WorkQueueManager.h
+++ b/Tools/WebKitTestRunner/WorkQueueManager.h
@@ -43,7 +43,9 @@ public:
bool processWorkQueue(); // Returns 'true' if queue is processed (no new loading is started), returns 'false' otherwise.
void queueLoad(const String& url, const String& target);
+ void queueLoadHTMLString(const String& content, const String& baseURL, const String& unreachableURL);
void queueBackNavigation(unsigned howFarBackward);
+ void queueForwardNavigation(unsigned howFarForward);
void queueReload();
void queueLoadingScript(const String& script);
void queueNonLoadingScript(const String& script);
diff --git a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
index fc225e3f4..f2829a96c 100644
--- a/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/EventSenderProxyEfl.cpp
@@ -56,14 +56,6 @@ enum WTREventType {
WTREventTypeLeapForward
};
-enum WTRMouseButton {
- WTRMouseButtonNone = -1,
- WTRMouseButtonLeft,
- WTRMouseButtonMiddle,
- WTRMouseButtonRight,
- WTRMouseButtonMiddleDuplicated,
-};
-
enum EvasMouseButton {
EvasMouseButtonNone = 0,
EvasMouseButtonLeft,
@@ -121,15 +113,14 @@ struct KeyEventInfo : public RefCounted<KeyEventInfo> {
static unsigned evasMouseButton(unsigned button)
{
- if (button == WTRMouseButtonLeft)
- return EvasMouseButtonLeft;
- if (button == WTRMouseButtonMiddle)
+ // The common case involves converting from a WKEventMouseButton (which
+ // starts at -1) to an EvasMouseButton (which a starts at 0). The special
+ // case for button 3 exists because of fast/events/mouse-click-events.html,
+ // which tests whether a 4th mouse button behaves as the middle one.
+ if (button <= kWKEventMouseButtonRightButton)
+ return button + 1;
+ if (button == kWKEventMouseButtonRightButton + 1)
return EvasMouseButtonMiddle;
- if (button == WTRMouseButtonRight)
- return EvasMouseButtonRight;
- if (button == WTRMouseButtonMiddleDuplicated)
- return EvasMouseButtonMiddle;
-
return EvasMouseButtonNone;
}
@@ -292,8 +283,8 @@ EventSenderProxy::EventSenderProxy(TestController* testController)
, m_leftMouseButtonDown(false)
, m_clickCount(0)
, m_clickTime(0)
- , m_clickButton(WTRMouseButtonNone)
- , m_mouseButton(WTRMouseButtonNone)
+ , m_clickButton(kWKEventMouseButtonNoButton)
+ , m_mouseButton(kWKEventMouseButtonNoButton)
#if ENABLE(TOUCH_EVENTS)
, m_touchPoints(0)
#endif
@@ -371,7 +362,7 @@ void EventSenderProxy::mouseUp(unsigned button, WKEventModifiers wkModifiers)
sendOrQueueEvent(WTREvent(WTREventTypeMouseUp, 0, wkModifiers, evasMouseButton(button)));
if (m_mouseButton == button)
- m_mouseButton = WTRMouseButtonNone;
+ m_mouseButton = kWKEventMouseButtonNoButton;
m_clickPosition = m_position;
m_clickTime = ecore_time_get();
@@ -382,12 +373,12 @@ void EventSenderProxy::mouseMoveTo(double x, double y)
m_position.x = x;
m_position.y = y;
- sendOrQueueEvent(WTREvent(WTREventTypeMouseMove, 0, 0, WTRMouseButtonNone));
+ sendOrQueueEvent(WTREvent(WTREventTypeMouseMove, 0, 0, kWKEventMouseButtonNoButton));
}
void EventSenderProxy::mouseScrollBy(int horizontal, int vertical)
{
- WTREvent event(WTREventTypeMouseScrollBy, 0, 0, WTRMouseButtonNone);
+ WTREvent event(WTREventTypeMouseScrollBy, 0, 0, kWKEventMouseButtonNoButton);
// We need to invert scrolling values since in EFL negative z value means that
// canvas is scrolling down
event.horizontal = -horizontal;
@@ -403,7 +394,7 @@ void EventSenderProxy::continuousMouseScrollBy(int horizontal, int vertical, boo
void EventSenderProxy::leapForward(int milliseconds)
{
if (m_eventQueue.isEmpty())
- m_eventQueue.append(WTREvent(WTREventTypeLeapForward, milliseconds, 0, WTRMouseButtonNone));
+ m_eventQueue.append(WTREvent(WTREventTypeLeapForward, milliseconds, 0, kWKEventMouseButtonNoButton));
m_time += milliseconds / 1000.0;
}
diff --git a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
index 06187a066..cb957d5d9 100644
--- a/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
+++ b/Tools/WebKitTestRunner/efl/PlatformWebViewEfl.cpp
@@ -30,7 +30,11 @@ namespace WTR {
static Ecore_Evas* initEcoreEvas()
{
- Ecore_Evas* ecoreEvas = ecore_evas_new(0, 0, 0, 800, 600, 0);
+ const char* engine = 0;
+#if defined(WTF_USE_ACCELERATED_COMPOSITING) && defined(HAVE_ECORE_X)
+ engine = "opengl_x11";
+#endif
+ Ecore_Evas* ecoreEvas = ecore_evas_new(engine, 0, 0, 800, 600, 0);
if (!ecoreEvas)
return 0;
@@ -40,7 +44,7 @@ static Ecore_Evas* initEcoreEvas()
return ecoreEvas;
}
-PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup)
+PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef /*options*/)
{
m_window = initEcoreEvas();
Evas* evas = ecore_evas_get(m_window);
@@ -69,6 +73,11 @@ WKPageRef PlatformWebView::page()
void PlatformWebView::focus()
{
+ // In a few cases, an iframe might receive focus from JavaScript and Evas is not aware of it at all
+ // (WebCoreSupport::focusedFrameChanged() does not emit any notification). We then manually remove the
+ // focus from the view to make the call give focus to evas_object_focus_set(..., true) to be effectful.
+ if (WKPageGetFocusedFrame(page()) != WKPageGetMainFrame(page()))
+ evas_object_focus_set(m_view, false);
evas_object_focus_set(m_view, true);
}
diff --git a/Tools/WebKitTestRunner/efl/main.cpp b/Tools/WebKitTestRunner/efl/main.cpp
index 70b2a4485..b02ff357d 100644
--- a/Tools/WebKitTestRunner/efl/main.cpp
+++ b/Tools/WebKitTestRunner/efl/main.cpp
@@ -24,10 +24,24 @@
#include <wtf/Assertions.h>
#include <stdlib.h>
+#ifdef HAVE_ECORE_X
+#include <X11/Xlib.h>
+#include <X11/extensions/Xext.h>
+
+static int dummyExtensionErrorHandler(Display*, _Xconst char*, _Xconst char*)
+{
+ return 0;
+}
+#endif
+
int main(int argc, char** argv)
{
WTFInstallReportBacktraceOnCrashHook();
+#ifdef HAVE_ECORE_X
+ XSetExtensionErrorHandler(dummyExtensionErrorHandler);
+#endif
+
if (!ewk_init())
return 1;
diff --git a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
index 7c7d590e9..cdbaec5b2 100644
--- a/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
+++ b/Tools/WebKitTestRunner/gtk/EventSenderProxyGtk.cpp
@@ -83,6 +83,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController)
{
}
+EventSenderProxy::~EventSenderProxy()
+{
+}
+
static guint getMouseButtonModifiers(int gdkButton)
{
if (gdkButton == 1)
diff --git a/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp b/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
index f1615d4ac..bbef04ead 100644
--- a/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
+++ b/Tools/WebKitTestRunner/gtk/PlatformWebViewGtk.cpp
@@ -33,7 +33,7 @@
namespace WTR {
-PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup)
+PlatformWebView::PlatformWebView(WKContextRef context, WKPageGroupRef pageGroup, WKDictionaryRef /*options*/)
: m_view(WKViewCreate(context, pageGroup))
, m_window(gtk_window_new(GTK_WINDOW_POPUP))
, m_windowIsKey(true)
diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
index dfe10745d..ece5b523e 100644
--- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
+++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm
@@ -111,6 +111,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController)
{
}
+EventSenderProxy::~EventSenderProxy()
+{
+}
+
void EventSenderProxy::updateClickCountForButton(int button)
{
if (m_time - m_clickTime < 1 && m_position == m_clickPosition && button == m_clickButton) {
@@ -385,15 +389,11 @@ void EventSenderProxy::mouseScrollBy(int x, int y)
RetainPtr<CGEventRef> cgScrollEvent(AdoptCF, CGEventCreateScrollWheelEvent(0, kCGScrollEventUnitLine, 2, y, x));
// CGEvent locations are in global display coordinates.
- CGPoint lastGlobalMousePosition = {
- m_position.x,
- [[NSScreen mainScreen] frame].size.height - m_position.y
- };
+ CGPoint lastGlobalMousePosition = CGPointMake(m_position.x, [[NSScreen mainScreen] frame].size.height - m_position.y);
CGEventSetLocation(cgScrollEvent.get(), lastGlobalMousePosition);
NSEvent *event = [NSEvent eventWithCGEvent:cgScrollEvent.get()];
- NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]];
- if (targetView)
+ if (NSView *targetView = [m_testController->mainWebView()->platformView() hitTest:[event locationInWindow]])
[targetView scrollWheel:event];
}
diff --git a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
index db5d1197c..4c7b15f58 100644
--- a/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
+++ b/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
@@ -25,6 +25,7 @@
#include "config.h"
#include "PlatformWebView.h"
+#include "TestController.h"
#import <WebKit2/WKImageCG.h>
#import <WebKit2/WKViewPrivate.h>
@@ -37,6 +38,32 @@
@property (nonatomic, assign) WTR::PlatformWebView* platformWebView;
@end
+@interface TestRunnerWKView : WKView {
+ BOOL _useTiledDrawing;
+}
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)context pageGroupRef:(WKPageGroupRef)pageGroup useTiledDrawing:(BOOL)useTiledDrawing;
+
+@property (nonatomic, assign) BOOL useTiledDrawing;
+@end
+
+@implementation TestRunnerWKView
+
+@synthesize useTiledDrawing = _useTiledDrawing;
+
+- (id)initWithFrame:(NSRect)frame contextRef:(WKContextRef)context pageGroupRef:(WKPageGroupRef)pageGroup useTiledDrawing:(BOOL)useTiledDrawing
+{
+ _useTiledDrawing = useTiledDrawing;
+ return [super initWithFrame:frame contextRef:context pageGroupRef:pageGroup];
+}
+
+- (BOOL)_shouldUseTiledDrawingArea
+{
+ return _useTiledDrawing;
+}
+
+@end
+
@implementation WebKitTestRunnerWindow
@synthesize platformWebView = _platformWebView;
@@ -78,11 +105,14 @@
namespace WTR {
-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef options)
: m_windowIsKey(true)
{
+ WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing"));
+ bool useTiledDrawing = options ? WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get()))) : false;
+
NSRect rect = NSMakeRect(0, 0, 800, 600);
- m_view = [[WKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef];
+ m_view = [[TestRunnerWKView alloc] initWithFrame:rect contextRef:contextRef pageGroupRef:pageGroupRef useTiledDrawing:useTiledDrawing];
NSRect windowRect = NSOffsetRect(rect, -10000, [(NSScreen *)[[NSScreen screens] objectAtIndex:0] frame].size.height - rect.size.height + 10000);
m_window = [[WebKitTestRunnerWindow alloc] initWithContentRect:windowRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:YES];
@@ -168,4 +198,12 @@ WKRetainPtr<WKImageRef> PlatformWebView::windowSnapshotImage()
return adoptWK(WKImageCreateFromCGImage(windowSnapshotImage.get(), 0));
}
+bool PlatformWebView::viewSupportsOptions(WKDictionaryRef options) const
+{
+ WKRetainPtr<WKStringRef> useTiledDrawingKey(AdoptWK, WKStringCreateWithUTF8CString("TiledDrawing"));
+ bool useTiledDrawing = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(options, useTiledDrawingKey.get())));
+
+ return useTiledDrawing == [(TestRunnerWKView *)m_view useTiledDrawing];
+}
+
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/mac/main.mm b/Tools/WebKitTestRunner/mac/main.mm
index 12326a4d3..b5c34f769 100644
--- a/Tools/WebKitTestRunner/mac/main.mm
+++ b/Tools/WebKitTestRunner/mac/main.mm
@@ -31,6 +31,7 @@ int main(int argc, const char* argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[NSApplication sharedApplication];
+ [[NSUserDefaults standardUserDefaults] setVolatileDomain:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"WebKitKerningAndLigaturesEnabledByDefault"] forName:NSArgumentDomain];
{
WTR::TestController controller(argc, argv);
}
diff --git a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
index 7619d3160..e16e3efe0 100644
--- a/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
+++ b/Tools/WebKitTestRunner/qt/EventSenderProxyQt.cpp
@@ -72,6 +72,10 @@ EventSenderProxy::EventSenderProxy(TestController* testController)
isReplayingEvents = false;
}
+EventSenderProxy::~EventSenderProxy()
+{
+}
+
static Qt::MouseButton getMouseButton(unsigned button)
{
Qt::MouseButton mouseButton;
@@ -246,12 +250,10 @@ void EventSenderProxy::keyDown(WKStringRef keyRef, WKEventModifiers modifiersRef
void EventSenderProxy::updateClickCountForButton(int button)
{
if (m_time - m_clickTime < QApplication::doubleClickInterval() && m_position == m_clickPosition && button == m_clickButton) {
- ++m_clickCount;
m_clickTime = m_time;
return;
}
- m_clickCount = 1;
m_clickTime = m_time;
m_clickPosition = m_position;
m_clickButton = button;
@@ -267,9 +269,10 @@ void EventSenderProxy::mouseDown(unsigned button, WKEventModifiers wkModifiers)
m_mouseButtons |= mouseButton;
QPoint mousePos(m_position.x, m_position.y);
- QMouseEvent* event = new QMouseEvent((m_clickCount == 2) ? QEvent::MouseButtonDblClick : QEvent::MouseButtonPress,
+ QMouseEvent* event = new QMouseEvent(QEvent::MouseButtonPress,
mousePos, mousePos, mouseButton, m_mouseButtons, modifiers);
+ // We aren't generating MouseButtonDblClick events as they aren't used.
sendOrQueueEvent(event);
}
diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
index 00177db81..e1cce48a5 100644
--- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
+++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp
@@ -66,10 +66,8 @@ private Q_SLOTS:
setSurfaceType(OpenGLSurface);
create();
QQuickWindowPrivate::get(this)->setRenderWithoutShowing(true);
- } else {
- QQuickWebViewExperimental experimental(m_view);
- experimental.setRenderToOffscreenBuffer(true);
- }
+ } else
+ m_view->experimental()->setRenderToOffscreenBuffer(true);
QWindowSystemInterface::handleWindowActivated(this);
m_view->page()->setFocus(true);
@@ -79,7 +77,7 @@ private:
QQuickWebView* m_view;
};
-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/)
: m_view(new QQuickWebView(contextRef, pageGroupRef))
, m_window(new WrapperWindow(m_view))
, m_windowIsKey(true)
diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp
index 31b750681..3c9d311c9 100644
--- a/Tools/WebKitTestRunner/qt/main.cpp
+++ b/Tools/WebKitTestRunner/qt/main.cpp
@@ -26,7 +26,7 @@
#include "config.h"
-#include "QtInitializeTestFonts.h"
+#include "QtTestSupport.h"
#include "TestController.h"
#include "qquickwebview_p.h"
@@ -119,7 +119,7 @@ int main(int argc, char** argv)
qputenv("QT_WEBKIT_THEME_NAME", "qstyle");
- WebKit::initializeTestFonts();
+ WebKit::QtTestSupport::initializeTestFonts();
QCoreApplication::setAttribute(Qt::AA_Use96Dpi, true);
QQuickWebViewExperimental::setFlickableViewportEnabled(false);
diff --git a/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp b/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp
index 2fbcef922..91a03d2a3 100644
--- a/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp
+++ b/Tools/WebKitTestRunner/win/PlatformWebViewWin.cpp
@@ -48,7 +48,7 @@ static void registerWindowClass()
RegisterClassExW(&wndClass);
}
-PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+PlatformWebView::PlatformWebView(WKContextRef contextRef, WKPageGroupRef pageGroupRef, WKDictionaryRef /*options*/)
: m_windowIsKey(true)
{
registerWindowClass();