summaryrefslogtreecommitdiff
path: root/Tools/WebKitTestRunner/TestInvocation.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-18 14:10:51 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-18 14:10:51 +0200
commitd9cf437c840c6eb7417bdd97e6c40979255d3158 (patch)
treea231782c949300763457407149cfd84c20e0222e /Tools/WebKitTestRunner/TestInvocation.cpp
parentee4c86d1990a9e26277a6948e7027ad8d525ebfa (diff)
downloadqtwebkit-d9cf437c840c6eb7417bdd97e6c40979255d3158.tar.gz
Imported WebKit commit a1c73566da3265b6c5dc815a24b0e5ab02d2c885 (http://svn.webkit.org/repository/webkit/trunk@131728)
New snapshot with a better fix for the out-of-memory at link time situation.
Diffstat (limited to 'Tools/WebKitTestRunner/TestInvocation.cpp')
-rw-r--r--Tools/WebKitTestRunner/TestInvocation.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/Tools/WebKitTestRunner/TestInvocation.cpp b/Tools/WebKitTestRunner/TestInvocation.cpp
index 31b998890..040adb544 100644
--- a/Tools/WebKitTestRunner/TestInvocation.cpp
+++ b/Tools/WebKitTestRunner/TestInvocation.cpp
@@ -192,6 +192,8 @@ void TestInvocation::invoke()
goto end;
}
+ dumpResults();
+
end:
#if ENABLE(INSPECTOR)
if (m_gotInitialResponse)
@@ -235,6 +237,17 @@ void TestInvocation::dump(const char* textToStdout, const char* textToStderr, bo
fflush(stderr);
}
+void TestInvocation::dumpResults()
+{
+ dump(toWTFString(m_textOutput.get()).utf8().data());
+
+ if (m_dumpPixels && m_pixelResult)
+ dumpPixelsAndCompareWithExpected(m_pixelResult.get(), m_repaintRects.get());
+
+ fputs("#EOF\n", stdout);
+ fflush(stdout);
+}
+
bool TestInvocation::compareActualHashToExpectedAndDumpResults(const char actualHash[33])
{
// Compute the hash of the bitmap context pixels
@@ -278,26 +291,15 @@ void TestInvocation::didReceiveMessageFromInjectedBundle(WKStringRef messageName
WKDictionaryRef messageBodyDictionary = static_cast<WKDictionaryRef>(messageBody);
WKRetainPtr<WKStringRef> textOutputKey(AdoptWK, WKStringCreateWithUTF8CString("TextOutput"));
- WKStringRef textOutput = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOutputKey.get()));
+ m_textOutput = static_cast<WKStringRef>(WKDictionaryGetItemForKey(messageBodyDictionary, textOutputKey.get()));
WKRetainPtr<WKStringRef> pixelResultKey = adoptWK(WKStringCreateWithUTF8CString("PixelResult"));
- WKImageRef pixelResult = static_cast<WKImageRef>(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get()));
- ASSERT(!pixelResult || m_dumpPixels);
-
- WKRetainPtr<WKStringRef> repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString("RepaintRects"));
- WKArrayRef repaintRects = static_cast<WKArrayRef>(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get()));
+ m_pixelResult = static_cast<WKImageRef>(WKDictionaryGetItemForKey(messageBodyDictionary, pixelResultKey.get()));
+ ASSERT(!m_pixelResult || m_dumpPixels);
- // Dump text.
- dump(toWTFString(textOutput).utf8().data());
-
- // Dump pixels (if necessary).
- if (m_dumpPixels && pixelResult)
- dumpPixelsAndCompareWithExpected(pixelResult, repaintRects);
+ WKRetainPtr<WKStringRef> repaintRectsKey = adoptWK(WKStringCreateWithUTF8CString("RepaintRects"));
+ m_repaintRects = static_cast<WKArrayRef>(WKDictionaryGetItemForKey(messageBodyDictionary, repaintRectsKey.get()));
- fputs("#EOF\n", stdout);
- fflush(stdout);
- fflush(stderr);
-
m_gotFinalMessage = true;
TestController::shared().notifyDone();
return;