Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2035)

Unified Diff: content/shell/layout_test_controller_host.cc

Issue 10836291: Don't dump pixel results if we fail to encode the image (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/shell/layout_test_controller_host.cc
diff --git a/content/shell/layout_test_controller_host.cc b/content/shell/layout_test_controller_host.cc
index eeb6063c1bd6dd24ee366c78daf9746213f90201..88ab1769568ef884c12b44ebcc4cf84f379d9f3e 100644
--- a/content/shell/layout_test_controller_host.cc
+++ b/content/shell/layout_test_controller_host.cc
@@ -139,18 +139,18 @@ void LayoutTestControllerHost::OnImageDump(
bool discard_transparency = true;
#endif
- webkit_support::EncodeBGRAPNGWithChecksum(
- reinterpret_cast<const unsigned char*>(image.getPixels()),
- image.width(),
- image.height(),
- static_cast<int>(image.rowBytes()),
- discard_transparency,
- actual_pixel_hash,
- &png);
-
- printf("Content-Type: image/png\n");
- printf("Content-Length: %u\n", static_cast<unsigned>(png.size()));
- fwrite(&png[0], 1, png.size(), stdout);
+ if (webkit_support::EncodeBGRAPNGWithChecksum(
+ reinterpret_cast<const unsigned char*>(image.getPixels()),
+ image.width(),
+ image.height(),
+ static_cast<int>(image.rowBytes()),
+ discard_transparency,
+ actual_pixel_hash,
+ &png)) {
+ printf("Content-Type: image/png\n");
+ printf("Content-Length: %u\n", static_cast<unsigned>(png.size()));
+ fwrite(&png[0], 1, png.size(), stdout);
+ }
}
MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698