diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-03-12 14:11:15 +0100 |
commit | dd91e772430dc294e3bf478c119ef8d43c0a3358 (patch) | |
tree | 6f33ce4d5872a5691e0291eb45bf6ab373a5f567 /Tools/WebKitTestRunner | |
parent | ad0d549d4cc13433f77c1ac8f0ab379c83d93f28 (diff) | |
download | qtwebkit-dd91e772430dc294e3bf478c119ef8d43c0a3358.tar.gz |
Imported WebKit commit 3db4eb1820ac8fb03065d7ea73a4d9db1e8fea1a (http://svn.webkit.org/repository/webkit/trunk@110422)
This includes build fixes for the latest qtbase/qtdeclarative as well as the final QML2 API.
Diffstat (limited to 'Tools/WebKitTestRunner')
23 files changed, 92 insertions, 42 deletions
diff --git a/Tools/WebKitTestRunner/Configurations/Base.xcconfig b/Tools/WebKitTestRunner/Configurations/Base.xcconfig index be9499a35..8374385fd 100644 --- a/Tools/WebKitTestRunner/Configurations/Base.xcconfig +++ b/Tools/WebKitTestRunner/Configurations/Base.xcconfig @@ -23,7 +23,7 @@ #include "CompilerVersion.xcconfig" -HEADER_SEARCH_PATHS = $(WEBCORE_PRIVATE_HEADERS_DIR)/ForwardingHeaders ${SRCROOT}/../../Source/JavaScriptCore/icu $(NEXT_ROOT)/usr/local/include/WebCoreTestSupport; +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; GCC_PREPROCESSOR_DEFINITIONS = ENABLE_DASHBOARD_SUPPORT WEBKIT_VERSION_MIN_REQUIRED=WEBKIT_VERSION_LATEST; DEBUG_INFORMATION_FORMAT = dwarf diff --git a/Tools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops b/Tools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops index f870803aa..cfb56400b 100644 --- a/Tools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops +++ b/Tools/WebKitTestRunner/Configurations/InjectedBundleCommon.vsprops @@ -6,7 +6,7 @@ > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ProjectDir)\..\InjectedBundle\";"$(ProjectDir)\..\InjectedBundle\Bindings";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(ConfigurationBuildDir)\include\WebCoreTestSupport";"$(WebKitLibrariesDir)\include";"$(ConfigurationBuildDir)\obj\InjectedBundle\DerivedSources\"" + AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ProjectDir)\..\InjectedBundle\";"$(ProjectDir)\..\InjectedBundle\Bindings";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(ConfigurationBuildDir)\Include\private\JavaScriptCore";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(ConfigurationBuildDir)\include\WebCoreTestSupport";"$(WebKitLibrariesDir)\include";"$(ConfigurationBuildDir)\obj\InjectedBundle\DerivedSources\"" ForcedIncludeFiles="WebKitTestRunnerPrefix.h" /> </VisualStudioPropertySheet> diff --git a/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops b/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops index b8b693696..e7232b059 100644 --- a/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops +++ b/Tools/WebKitTestRunner/Configurations/WebKitTestRunnerCommon.vsprops @@ -6,7 +6,7 @@ > <Tool Name="VCCLCompilerTool" - AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include"" + AdditionalIncludeDirectories=""$(ProjectDir)\..";"$(ConfigurationBuildDir)\Include";"$(ConfigurationBuildDir)\Include\private";"$(ConfigurationBuildDir)\Include\private\JavaScriptCore";"$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders";"$(WebKitLibrariesDir)\Include"" PreprocessorDefinitions="__WIN32__;_CONSOLE" DisableSpecificWarnings="4146" ForcedIncludeFiles="WebKitTestRunnerPrefix.h" diff --git a/Tools/WebKitTestRunner/GNUmakefile.am b/Tools/WebKitTestRunner/GNUmakefile.am index 577375f35..a644e75fb 100644 --- a/Tools/WebKitTestRunner/GNUmakefile.am +++ b/Tools/WebKitTestRunner/GNUmakefile.am @@ -62,7 +62,9 @@ Programs_WebKitTestRunner_LDFLAGS = \ -no-install # The InjectedBundle library allows the render process to load harness code. +if ENABLE_WEBKIT2 noinst_LTLIBRARIES += Libraries/libTestRunnerInjectedBundle.la +endif webkittestrunner_built_sources += \ DerivedSources/InjectedBundle/JSAccessibilityController.cpp \ diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp index 4daac7426..5023f141e 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp @@ -51,6 +51,7 @@ InjectedBundle::InjectedBundle() , m_topLoadingFrame(0) , m_state(Idle) , m_dumpPixels(false) + , m_useWaitToDumpWatchdogTimer(true) { } @@ -131,8 +132,14 @@ void InjectedBundle::didReceiveMessage(WKStringRef messageName, WKTypeRef messag { if (WKStringIsEqualToUTF8CString(messageName, "BeginTest")) { ASSERT(messageBody); - ASSERT(WKGetTypeID(messageBody) == WKBooleanGetTypeID()); - m_dumpPixels = WKBooleanGetValue(static_cast<WKBooleanRef>(messageBody)); + ASSERT(WKGetTypeID(messageBody) == WKDictionaryGetTypeID()); + WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody); + + WKRetainPtr<WKStringRef> dumpPixelsKey(AdoptWK, WKStringCreateWithUTF8CString("DumpPixels")); + m_dumpPixels = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, dumpPixelsKey.get()))); + + WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey(AdoptWK, WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer")); + m_useWaitToDumpWatchdogTimer = WKBooleanGetValue(static_cast<WKBooleanRef>(WKDictionaryGetItemForKey(messageBodyDictionary, useWaitToDumpWatchdogTimerKey.get()))); WKRetainPtr<WKStringRef> ackMessageName(AdoptWK, WKStringCreateWithUTF8CString("Ack")); WKRetainPtr<WKStringRef> ackMessageBody(AdoptWK, WKStringCreateWithUTF8CString("BeginTest")); diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h index 86041bd61..d90e4e071 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h @@ -76,6 +76,7 @@ public: void setTopLoadingFrame(WKBundleFrameRef frame) { m_topLoadingFrame = frame; } bool shouldDumpPixels() const { return m_dumpPixels; } + bool useWaitToDumpWatchdogTimer() const { return m_useWaitToDumpWatchdogTimer; } void postNewBeforeUnloadReturnValue(bool); void postAddChromeInputField(); @@ -125,6 +126,7 @@ private: State m_state; bool m_dumpPixels; + bool m_useWaitToDumpWatchdogTimer; WKRetainPtr<WKImageRef> m_pixelResult; WKRetainPtr<WKArrayRef> m_repaintRects; diff --git a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp index 84f90d804..edf66dea5 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp @@ -215,6 +215,7 @@ InjectedBundlePage::InjectedBundlePage(WKBundlePageRef page) willPerformClientRedirectForFrame, didHandleOnloadEventsForFrame, 0, // didLayoutForFrame + 0, // didNewFirstVisuallyNonEmptyLayoutForFrame didDetectXSSForFrame, }; WKBundlePageSetPageLoaderClient(m_page, &loaderClient); diff --git a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp index a78e74112..fbdb5dcf7 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp +++ b/Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.cpp @@ -150,7 +150,8 @@ void LayoutTestController::waitForPolicyDelegate() void LayoutTestController::waitUntilDone() { m_waitToDump = true; - initializeWaitToDumpWatchdogTimerIfNeeded(); + if (InjectedBundle::shared().useWaitToDumpWatchdogTimer()) + initializeWaitToDumpWatchdogTimerIfNeeded(); } void LayoutTestController::waitToDumpWatchdogTimerFired() diff --git a/Tools/WebKitTestRunner/InjectedBundle/Target.pri b/Tools/WebKitTestRunner/InjectedBundle/Target.pri index de5b63b90..7d382ac97 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/Target.pri +++ b/Tools/WebKitTestRunner/InjectedBundle/Target.pri @@ -50,13 +50,13 @@ HEADERS += \ DESTDIR = $${ROOT_BUILD_DIR}/lib -QT += declarative widgets +QT += declarative widgets webkit load(features) WEBKIT += wtf javascriptcore webcore -CONFIG += plugin qtwebkit rpath +CONFIG += plugin rpath contains(DEFINES, HAVE_FONTCONFIG=1): PKGCONFIG += fontconfig diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm index e989880e5..40bacfcd5 100644 --- a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm +++ b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm @@ -124,7 +124,7 @@ static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObjec return NULL; if ([valueObject isKindOfClass:[NSArray class]]) - return [NSString stringWithFormat:@"<array of size %d>", [(NSArray*)valueObject count]]; + return [NSString stringWithFormat:@"<array of size %lu>", static_cast<unsigned long>([(NSArray*)valueObject count])]; if ([valueObject isKindOfClass:[NSNumber class]]) return [(NSNumber*)valueObject stringValue]; @@ -1029,12 +1029,12 @@ int AccessibilityUIElement::indexInTable() JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() { - NSRange range = NSMakeRange(0,0); + NSRange range = NSMakeRange(0, 0); BEGIN_AX_OBJC_EXCEPTIONS NSValue* indexRange = [m_element accessibilityAttributeValue:@"AXRowIndexRange"]; if (indexRange) range = [indexRange rangeValue]; - NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; + NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", static_cast<unsigned long>(range.location), static_cast<unsigned long>(range.length)]; return [rangeDescription createJSStringRef]; END_AX_OBJC_EXCEPTIONS @@ -1043,13 +1043,13 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange() { - NSRange range = NSMakeRange(0,0); + NSRange range = NSMakeRange(0, 0); BEGIN_AX_OBJC_EXCEPTIONS NSNumber* indexRange = [m_element accessibilityAttributeValue:@"AXColumnIndexRange"]; if (indexRange) range = [indexRange rangeValue]; - NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; - return [rangeDescription createJSStringRef]; + NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", static_cast<unsigned long>(range.location), static_cast<unsigned long>(range.length)]; + return [rangeDescription createJSStringRef]; END_AX_OBJC_EXCEPTIONS return 0; @@ -1090,8 +1090,8 @@ JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange() NSValue *indexRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextRangeAttribute]; if (indexRange) range = [indexRange rangeValue]; - NSMutableString *rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length]; - return [rangeDescription createJSStringRef]; + NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", static_cast<unsigned long>(range.location), static_cast<unsigned long>(range.length)]; + return [rangeDescription createJSStringRef]; END_AX_OBJC_EXCEPTIONS return 0; diff --git a/Tools/WebKitTestRunner/Target.pri b/Tools/WebKitTestRunner/Target.pri index bbd7cecfc..6f1da953d 100644 --- a/Tools/WebKitTestRunner/Target.pri +++ b/Tools/WebKitTestRunner/Target.pri @@ -25,14 +25,12 @@ SOURCES += \ DESTDIR = $${ROOT_BUILD_DIR}/bin -QT = core gui widgets network declarative testlib quick +QT = core gui widgets network declarative testlib quick webkit load(features) WEBKIT += wtf javascriptcore webkit2 -CONFIG += qtwebkit - DEFINES += USE_SYSTEM_MALLOC=1 PREFIX_HEADER = WebKitTestRunnerPrefix.h diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp index 0262b5331..42e0c7274 100644 --- a/Tools/WebKitTestRunner/TestController.cpp +++ b/Tools/WebKitTestRunner/TestController.cpp @@ -46,6 +46,7 @@ namespace WTR { static const double defaultLongTimeout = 30; static const double defaultShortTimeout = 5; +static const double defaultNoTimeout = -1; static WKURLRef blankURL() { @@ -72,6 +73,8 @@ TestController::TestController(int argc, const char* argv[]) , m_doneResetting(false) , m_longTimeout(defaultLongTimeout) , m_shortTimeout(defaultShortTimeout) + , m_noTimeout(defaultNoTimeout) + , m_useWaitToDumpWatchdogTimer(true) , m_didPrintWebProcessCrashedMessage(false) , m_shouldExitWhenWebProcessCrashes(true) , m_beforeUnloadReturnValue(true) @@ -248,6 +251,11 @@ void TestController::initialize(int argc, const char* argv[]) continue; } + if (argument == "--no-timeout") { + m_useWaitToDumpWatchdogTimer = false; + continue; + } + if (argument == "--skip-pixel-test-if-no-baseline") { m_skipPixelTestOption = true; continue; @@ -537,7 +545,21 @@ void TestController::run() void TestController::runUntil(bool& done, TimeoutDuration timeoutDuration) { - platformRunUntil(done, timeoutDuration == ShortTimeout ? m_shortTimeout : m_longTimeout); + double timeout; + switch (timeoutDuration) { + case ShortTimeout: + timeout = m_shortTimeout; + break; + case LongTimeout: + timeout = m_longTimeout; + break; + case NoTimeout: + default: + timeout = m_noTimeout; + break; + } + + platformRunUntil(done, timeout); } // WKContextInjectedBundleClient diff --git a/Tools/WebKitTestRunner/TestController.h b/Tools/WebKitTestRunner/TestController.h index 32b4ade4b..ac9f1ff89 100644 --- a/Tools/WebKitTestRunner/TestController.h +++ b/Tools/WebKitTestRunner/TestController.h @@ -54,7 +54,8 @@ public: WKContextRef context() { return m_context.get(); } // Runs the run loop until `done` is true or the timeout elapses. - enum TimeoutDuration { ShortTimeout, LongTimeout }; + enum TimeoutDuration { ShortTimeout, LongTimeout, NoTimeout }; + bool useWaitToDumpWatchdogTimer() { return m_useWaitToDumpWatchdogTimer; } void runUntil(bool& done, TimeoutDuration); void notifyDone(); @@ -127,6 +128,8 @@ private: double m_longTimeout; double m_shortTimeout; + double m_noTimeout; + bool m_useWaitToDumpWatchdogTimer; bool m_didPrintWebProcessCrashedMessage; bool m_shouldExitWhenWebProcessCrashes; diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp index 9c663c483..f6fb31126 100644 --- a/Tools/WebKitTestRunner/TestInvocation.cpp +++ b/Tools/WebKitTestRunner/TestInvocation.cpp @@ -42,10 +42,8 @@ #include <direct.h> // For _getcwd. #define getcwd _getcwd // MSDN says getcwd is deprecated. #define PATH_MAX _MAX_PATH -#endif - -#if PLATFORM(MAC) -#include <unistd.h> +#else +#include <unistd.h> // For getcwd. #endif using namespace WebKit; @@ -142,8 +140,17 @@ void TestInvocation::invoke() sizeWebViewForCurrentTest(m_pathOrURL.c_str()); WKRetainPtr<WKStringRef> messageName = adoptWK(WKStringCreateWithUTF8CString("BeginTest")); - WKRetainPtr<WKBooleanRef> dumpPixels = adoptWK(WKBooleanCreate(m_dumpPixels)); - WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), dumpPixels.get()); + WKRetainPtr<WKMutableDictionaryRef> beginTestMessageBody = adoptWK(WKMutableDictionaryCreate()); + + WKRetainPtr<WKStringRef> dumpPixelsKey = adoptWK(WKStringCreateWithUTF8CString("DumpPixels")); + WKRetainPtr<WKBooleanRef> dumpPixelsValue = adoptWK(WKBooleanCreate(m_dumpPixels)); + WKDictionaryAddItem(beginTestMessageBody.get(), dumpPixelsKey.get(), dumpPixelsValue.get()); + + WKRetainPtr<WKStringRef> useWaitToDumpWatchdogTimerKey = adoptWK(WKStringCreateWithUTF8CString("UseWaitToDumpWatchdogTimer")); + WKRetainPtr<WKBooleanRef> useWaitToDumpWatchdogTimerValue = adoptWK(WKBooleanCreate(TestController::shared().useWaitToDumpWatchdogTimer())); + WKDictionaryAddItem(beginTestMessageBody.get(), useWaitToDumpWatchdogTimerKey.get(), useWaitToDumpWatchdogTimerValue.get()); + + WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get()); TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout); if (!m_gotInitialResponse) { @@ -160,7 +167,7 @@ void TestInvocation::invoke() WKPageLoadURL(TestController::shared().mainWebView()->page(), m_url.get()); - TestController::shared().runUntil(m_gotFinalMessage, TestController::LongTimeout); + TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout); if (!m_gotFinalMessage) dump("Timed out waiting for final message from web process\n"); else if (m_error) diff --git a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj index b400447b5..e3dc21143 100644 --- a/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj +++ b/Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj @@ -545,7 +545,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=\"${DT_TOOLCHAIN_DIR}/usr/bin/gcc-4.2\";;\n (LLVM_GCC_42)\n export CC=\"${DT_TOOLCHAIN_DIR}/usr/bin/llvm-gcc-4.2\";;\n (LLVM_COMPILER)\n export CC=\"${DT_TOOLCHAIN_DIR}/usr/bin/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 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"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp index e5f6a458a..90bdb7279 100644 --- a/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp +++ b/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp @@ -64,7 +64,8 @@ static gboolean timeoutCallback(gpointer) void TestController::platformRunUntil(bool&, double timeout) { cancelTimeout(); - gTimeoutSourceId = g_timeout_add(timeout * 1000, timeoutCallback, 0); + if (timeout != m_noTimeout) + gTimeoutSourceId = g_timeout_add(timeout * 1000, timeoutCallback, 0); gtk_main(); } diff --git a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm index 8d40dccc5..816cff988 100644 --- a/Tools/WebKitTestRunner/mac/EventSenderProxy.mm +++ b/Tools/WebKitTestRunner/mac/EventSenderProxy.mm @@ -30,7 +30,7 @@ #import "PlatformWebView.h" #import "StringFunctions.h" #import "TestController.h" -#import <JavaScriptCore/RetainPtr.h> +#import <wtf/RetainPtr.h> #import <WebKit2/WKString.h> namespace WTR { diff --git a/Tools/WebKitTestRunner/mac/TestControllerMac.mm b/Tools/WebKitTestRunner/mac/TestControllerMac.mm index c884c8fb1..a9e9f3190 100644 --- a/Tools/WebKitTestRunner/mac/TestControllerMac.mm +++ b/Tools/WebKitTestRunner/mac/TestControllerMac.mm @@ -53,6 +53,7 @@ void TestController::initializeTestPluginDirectory() void TestController::platformRunUntil(bool& done, double timeout) { + // FIXME: No timeout should occur if timeout is equal to m_noTimeout (necessary when running performance tests). CFAbsoluteTime end = CFAbsoluteTimeGetCurrent() + timeout; CFDateRef endDate = CFDateCreate(0, end); while (!done && CFAbsoluteTimeGetCurrent() < end) diff --git a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp index efff1eaf6..7f5123999 100644 --- a/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp +++ b/Tools/WebKitTestRunner/qt/PlatformWebViewQt.cpp @@ -55,14 +55,10 @@ private slots: return; setGeometry(0, 0, 800, 600); - m_view->setX(0); - m_view->setY(0); - m_view->setWidth(800); - m_view->setHeight(600); setResizeMode(QQuickView::SizeRootObjectToView); - m_view->setParentItem(rootObject()); + QDeclarativeProperty::write(m_view, "anchors.fill", qVariantFromValue(rootObject())); QWindowSystemInterface::handleWindowActivated(this); m_view->page()->setFocus(true); @@ -91,9 +87,15 @@ PlatformWebView::~PlatformWebView() void PlatformWebView::resizeTo(unsigned width, unsigned height) { + // If we do not have a platform window we will never get the necessary + // resize event, so simulate it in that case to make sure the quickview is + // resized to what the layout test expects. + if (!m_window->handle()) { + QRect newGeometry(m_window->x(), m_window->y(), width, height); + QWindowSystemInterface::handleSynchronousGeometryChange(m_window, newGeometry); + } + m_window->resize(width, height); - m_view->setWidth(width); - m_view->setHeight(height); } WKPageRef PlatformWebView::page() @@ -124,12 +126,12 @@ void PlatformWebView::setWindowFrame(WKRect wkRect) bool PlatformWebView::sendEvent(QEvent* event) { - return QCoreApplication::sendEvent(m_view, event); + return QCoreApplication::sendEvent(m_window, event); } void PlatformWebView::postEvent(QEvent* event) { - QCoreApplication::postEvent(m_view, event); + QCoreApplication::postEvent(m_window, event); } void PlatformWebView::addChromeInputField() diff --git a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp index fa827b6ad..158e8089a 100644 --- a/Tools/WebKitTestRunner/qt/TestControllerQt.cpp +++ b/Tools/WebKitTestRunner/qt/TestControllerQt.cpp @@ -55,8 +55,8 @@ void TestController::platformInitialize() void TestController::platformRunUntil(bool& condition, double timeout) { - if (qgetenv("QT_WEBKIT2_DEBUG") == "1") { - // Never timeout if we are debugging. + if (qgetenv("QT_WEBKIT2_DEBUG") == "1" || timeout == m_noTimeout) { + // Never timeout if we are debugging or not meant to timeout. while (!condition) QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, 50); return; diff --git a/Tools/WebKitTestRunner/qt/main.cpp b/Tools/WebKitTestRunner/qt/main.cpp index 6c447bda5..f9572a87e 100644 --- a/Tools/WebKitTestRunner/qt/main.cpp +++ b/Tools/WebKitTestRunner/qt/main.cpp @@ -92,6 +92,8 @@ int main(int argc, char** argv) qputenv("QT_WEBKIT_SUPPRESS_WEB_PROCESS_OUTPUT", "1"); } + qputenv("QT_WEBKIT_THEME_NAME", "qstyle"); + QQuickWebViewExperimental::setFlickableViewportEnabled(false); QApplication app(argc, argv); Launcher launcher(argc, argv); diff --git a/Tools/WebKitTestRunner/win/TestControllerWin.cpp b/Tools/WebKitTestRunner/win/TestControllerWin.cpp index 44a613835..ba4f753b4 100644 --- a/Tools/WebKitTestRunner/win/TestControllerWin.cpp +++ b/Tools/WebKitTestRunner/win/TestControllerWin.cpp @@ -172,6 +172,7 @@ static RunLoopResult runRunLoopUntil(bool& condition, HANDLE object, double time void TestController::platformRunUntil(bool& done, double timeout) { + // FIXME: No timeout should occur if timeout is equal to m_noTimeout (necessary when running performance tests). RunLoopResult result = runRunLoopUntil(done, webProcessCrashingEvent, timeout); if (result == TimedOut || result == ConditionSatisfied) return; diff --git a/Tools/WebKitTestRunner/win/build-generated-files.sh b/Tools/WebKitTestRunner/win/build-generated-files.sh index 8c599c19a..8c599c19a 100644..100755 --- a/Tools/WebKitTestRunner/win/build-generated-files.sh +++ b/Tools/WebKitTestRunner/win/build-generated-files.sh |