summaryrefslogtreecommitdiffstats
path: root/Tools/WebKitTestRunner/TestInvocation.cpp
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/TestInvocation.cpp
parentcfd86b747d32ac22246a1aa908eaa720c63a88c1 (diff)
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/TestInvocation.cpp')
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp31
1 files changed, 16 insertions, 15 deletions
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;
}