Commit e45c90cb authored by jochen@chromium.org's avatar jochen@chromium.org

Don't dump pixel results if we fail to encode the image

run_webkit_tests doesn't like Content-Length: 0 headers

BUG=none
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10836291

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151991 0039d316-1c4b-4281-b951-d872f2087c98
parent 6abe78ce
...@@ -139,18 +139,18 @@ void LayoutTestControllerHost::OnImageDump( ...@@ -139,18 +139,18 @@ void LayoutTestControllerHost::OnImageDump(
bool discard_transparency = true; bool discard_transparency = true;
#endif #endif
webkit_support::EncodeBGRAPNGWithChecksum( if (webkit_support::EncodeBGRAPNGWithChecksum(
reinterpret_cast<const unsigned char*>(image.getPixels()), reinterpret_cast<const unsigned char*>(image.getPixels()),
image.width(), image.width(),
image.height(), image.height(),
static_cast<int>(image.rowBytes()), static_cast<int>(image.rowBytes()),
discard_transparency, discard_transparency,
actual_pixel_hash, actual_pixel_hash,
&png); &png)) {
printf("Content-Type: image/png\n");
printf("Content-Type: image/png\n"); printf("Content-Length: %u\n", static_cast<unsigned>(png.size()));
printf("Content-Length: %u\n", static_cast<unsigned>(png.size())); fwrite(&png[0], 1, png.size(), stdout);
fwrite(&png[0], 1, png.size(), stdout); }
} }
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment