summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-11-09 09:42:44 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2012-11-09 09:42:44 +0100
commita59391482883479a9b28a6f1ace6d1ebd08a7ecd (patch)
treefa539db054a20a67bff2fc891c33b0f4ec632916 /Tools/WebKitTestRunner
parentcfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff)
downloadqtwebkit-a59391482883479a9b28a6f1ace6d1ebd08a7ecd.tar.gz
Imported WebKit commit 7bcdfab9a40db7d16b4b95bb77d78b8a59c9e701 (http://svn.webkit.org/repository/webkit/trunk@134025)
New snapshot with numerious build fixes, including MSVC 2012 and ARM Thumb-2.
Diffstat (limited to 'Tools/WebKitTestRunner')
-rw-r--r--Tools/WebKitTestRunner/TestController.cpp9
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp31
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.h5
-rw-r--r--Tools/WebKitTestRunner/qt/TestInvocationQt.cpp8
4 files changed, 32 insertions, 21 deletions
diff --git a/Tools/WebKitTestRunner/TestController.cpp b/Tools/WebKitTestRunner/TestController.cpp
index 07ff81bb7..2eb635b21 100644
--- a/Tools/WebKitTestRunner/TestController.cpp
+++ b/Tools/WebKitTestRunner/TestController.cpp
@@ -53,6 +53,10 @@
#include "EventSenderProxy.h"
#endif
+#if !PLATFORM(MAC)
+#include <WebKit2/WKTextChecker.h>
+#endif
+
namespace WTR {
// defaultLongTimeout + defaultShortTimeout should be less than 80,
@@ -550,6 +554,9 @@ bool TestController::resetStateToConsistentValues()
#endif
WKPreferencesSetScreenFontSubstitutionEnabled(preferences, true);
WKPreferencesSetInspectorUsesWebKitUserInterface(preferences, true);
+#if !PLATFORM(MAC)
+ WKTextCheckerContinuousSpellCheckingEnabledStateChanged(true);
+#endif
// in the case that a test using the chrome input field failed, be sure to clean up for the next test
m_mainWebView->removeChromeInputField();
@@ -696,7 +703,7 @@ void TestController::runTestingServerLoop()
void TestController::run()
{
if (!resetStateToConsistentValues()) {
- TestInvocation::dumpWebProcessUnresponsiveness("Failed to reset to consistent state before the first test");
+ m_currentInvocation->dumpWebProcessUnresponsiveness();
return;
}
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index 1cb56bb71..ef17437e4 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -104,6 +104,7 @@ TestInvocation::TestInvocation(const std::string& pathOrURL)
, m_gotFinalMessage(false)
, m_gotRepaint(false)
, m_error(false)
+ , m_webProcessIsUnrensponsive(false)
{
}
@@ -186,16 +187,14 @@ void TestInvocation::invoke()
WKContextPostMessageToInjectedBundle(TestController::shared().context(), messageName.get(), beginTestMessageBody.get());
- const char* errorMessage = 0;
TestController::shared().runUntil(m_gotInitialResponse, TestController::ShortTimeout);
if (!m_gotInitialResponse) {
- errorMessage = "Timed out waiting for initial response from web process\n";
+ m_errorMessage = "Timed out waiting for initial response from web process\n";
+ m_webProcessIsUnrensponsive = true;
goto end;
}
- if (m_error) {
- errorMessage = "FAIL\n";
+ if (m_error)
goto end;
- }
#if ENABLE(INSPECTOR)
if (shouldOpenWebInspector(m_pathOrURL.c_str()))
@@ -206,13 +205,12 @@ void TestInvocation::invoke()
TestController::shared().runUntil(m_gotFinalMessage, TestController::shared().useWaitToDumpWatchdogTimer() ? TestController::LongTimeout : TestController::NoTimeout);
if (!m_gotFinalMessage) {
- errorMessage = "Timed out waiting for final message from web process\n";
+ m_errorMessage = "Timed out waiting for final message from web process\n";
+ m_webProcessIsUnrensponsive = true;
goto end;
}
- if (m_error) {
- errorMessage = "FAIL\n";
+ if (m_error)
goto end;
- }
dumpResults();
@@ -222,13 +220,15 @@ end:
WKInspectorClose(WKPageGetInspector(TestController::shared().mainWebView()->page()));
#endif // ENABLE(INSPECTOR)
- if (errorMessage)
- dumpWebProcessUnresponsiveness(errorMessage);
- else if (!TestController::shared().resetStateToConsistentValues())
- dumpWebProcessUnresponsiveness("Timed out loading about:blank before the next test");
+ if (m_webProcessIsUnrensponsive)
+ dumpWebProcessUnresponsiveness();
+ else if (!TestController::shared().resetStateToConsistentValues()) {
+ m_errorMessage = "Timed out loading about:blank before the next test";
+ dumpWebProcessUnresponsiveness();
+ }
}
-void TestInvocation::dumpWebProcessUnresponsiveness(const char* textToStdout)
+void TestInvocation::dumpWebProcessUnresponsiveness()
{
const char* errorMessageToStderr = 0;
#if PLATFORM(MAC)
@@ -240,7 +240,7 @@ void TestInvocation::dumpWebProcessUnresponsiveness(const char* textToStdout)
errorMessageToStderr = "#PROCESS UNRESPONSIVE - WebProcess";
#endif
- dump(textToStdout, errorMessageToStderr, true);
+ dump(m_errorMessage.c_str(), errorMessageToStderr, true);
}
void TestInvocation::dump(const char* textToStdout, const char* textToStderr, bool seenError)
@@ -292,6 +292,7 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
m_gotInitialResponse = true;
m_gotFinalMessage = true;
m_error = true;
+ m_errorMessage = "FAIL\n";
TestController::shared().notifyDone();
return;
}
diff --git a/Tools/WebKitTestRunner/TestInvocation.h b/Tools/WebKitTestRunner/TestInvocation.h
index b5506551b..c14b060a3 100644
--- a/Tools/WebKitTestRunner/TestInvocation.h
+++ b/Tools/WebKitTestRunner/TestInvocation.h
@@ -44,7 +44,7 @@ public:
void didReceiveMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
WKRetainPtr<WKTypeRef> didReceiveSynchronousMessageFromInjectedBundle(WKStringRef messageName, WKTypeRef messageBody);
- static void dumpWebProcessUnresponsiveness(const char* textToStdout);
+ void dumpWebProcessUnresponsiveness();
private:
void dumpResults();
static void dump(const char* textToStdout, const char* textToStderr = 0, bool seenError = false);
@@ -71,6 +71,9 @@ private:
WKRetainPtr<WKStringRef> m_textOutput;
WKRetainPtr<WKImageRef> m_pixelResult;
WKRetainPtr<WKArrayRef> m_repaintRects;
+ std::string m_errorMessage;
+ bool m_webProcessIsUnrensponsive;
+
};
} // namespace WTR
diff --git a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
index 0c231508e..682a6377f 100644
--- a/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
+++ b/Tools/WebKitTestRunner/qt/TestInvocationQt.cpp
@@ -83,10 +83,10 @@ void TestInvocation::dumpPixelsAndCompareWithExpected(WKImageRef imageRef, WKArr
if (m_gotRepaint)
image = WKImageCreateQImage(TestController::shared().mainWebView()->windowSnapshotImage().get());
else {
- // The test harness expects an image so we output an empty one.
- WKRect windowRect = TestController::shared().mainWebView()->windowFrame();
- image = QImage(QSize(windowRect.size.width, windowRect.size.height), QImage::Format_ARGB32_Premultiplied);
- image.fill(Qt::red);
+ m_error = true;
+ m_errorMessage = "Timed out waiting for repaint\n";
+ m_webProcessIsUnrensponsive = true;
+ return;
}
} else
image = WKImageCreateQImage(imageRef);