diff options
Diffstat (limited to 'Tools/DumpRenderTree/PixelDumpSupport.cpp')
-rw-r--r-- | Tools/DumpRenderTree/PixelDumpSupport.cpp | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Tools/DumpRenderTree/PixelDumpSupport.cpp b/Tools/DumpRenderTree/PixelDumpSupport.cpp index ba619bbea..5160444bf 100644 --- a/Tools/DumpRenderTree/PixelDumpSupport.cpp +++ b/Tools/DumpRenderTree/PixelDumpSupport.cpp @@ -10,7 +10,7 @@ * 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 + * 3. Neither the name of Apple 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. * @@ -43,7 +43,6 @@ #include "PixelDumpSupportCairo.h" #endif -#if !PLATFORM(IOS) void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) { RefPtr<BitmapContext> context; @@ -58,14 +57,14 @@ void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) // Compute the hash of the bitmap context pixels char actualHash[33]; computeMD5HashStringForBitmapContext(context.get(), actualHash); - printf("\nActualHash: %s\n", actualHash); // FIXME: No need for the leading newline. + fprintf(testResult, "\nActualHash: %s\n", actualHash); // FIXME: No need for the leading newline. // Check the computed hash against the expected one and dump image on mismatch bool dumpImage = true; if (expectedHash.length() > 0) { ASSERT(expectedHash.length() == 32); - printf("\nExpectedHash: %s\n", expectedHash.c_str()); // FIXME: No need for the leading newline. + fprintf(testResult, "\nExpectedHash: %s\n", expectedHash.c_str()); // FIXME: No need for the leading newline. if (expectedHash == actualHash) // FIXME: do case insensitive compare dumpImage = false; @@ -74,7 +73,6 @@ void dumpWebViewAsPixelsAndCompareWithExpected(const std::string& expectedHash) if (dumpImage) dumpBitmap(context.get(), actualHash); } -#endif static void appendIntToVector(unsigned number, Vector<unsigned char>& vector) { @@ -116,20 +114,20 @@ void printPNG(const unsigned char* data, const size_t dataLength, const char* ch Vector<unsigned char> bytesToAdd; convertChecksumToPNGComment(checksum, bytesToAdd); - printf("Content-Type: %s\n", "image/png"); - printf("Content-Length: %lu\n", static_cast<unsigned long>(dataLength + bytesToAdd.size())); + fprintf(testResult, "Content-Type: image/png\n"); + fprintf(testResult, "Content-Length: %lu\n", static_cast<unsigned long>(dataLength + bytesToAdd.size())); size_t insertOffset = offsetAfterIHDRChunk(data, dataLength); - fwrite(data, 1, insertOffset, stdout); - fwrite(bytesToAdd.data(), 1, bytesToAdd.size(), stdout); + fwrite(data, 1, insertOffset, testResult); + fwrite(bytesToAdd.data(), 1, bytesToAdd.size(), testResult); const size_t bytesToWriteInOneChunk = 1 << 15; data += insertOffset; size_t dataRemainingToWrite = dataLength - insertOffset; while (dataRemainingToWrite) { size_t bytesToWriteInThisChunk = std::min(dataRemainingToWrite, bytesToWriteInOneChunk); - size_t bytesWritten = fwrite(data, 1, bytesToWriteInThisChunk, stdout); + size_t bytesWritten = fwrite(data, 1, bytesToWriteInThisChunk, testResult); if (bytesWritten != bytesToWriteInThisChunk) break; dataRemainingToWrite -= bytesWritten; |