From db269577f5f033c083d10b6327cbd1e1e32feb05 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Tue, 16 Jan 2018 19:02:15 +0000 Subject: Add WriteBitmapToPng to EmbedderTest. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a util method to output the png to a file for visually validating the result of an embedder test. Once validated, the md5 can be considered correct. Bug: pdfium:981 Change-Id: I544dfbf2e85295e6ca2cdf48d1bc3f0bd5f415e9 Reviewed-on: https://pdfium-review.googlesource.com/22990 Reviewed-by: Nicolás Peña Moreno Reviewed-by: dsinclair Commit-Queue: Henrique Nakashima --- testing/embedder_test.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'testing/embedder_test.h') diff --git a/testing/embedder_test.h b/testing/embedder_test.h index 8da1643824..98432e3e54 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -134,6 +134,12 @@ class EmbedderTest : public ::testing::Test, // Return the hash of |bitmap|. static std::string HashBitmap(FPDF_BITMAP bitmap); +#ifndef NDEBUG + // For debugging purposes. + // Write |bitmap| to a png file. + static void WriteBitmapToPng(FPDF_BITMAP bitmap, const std::string& filename); +#endif + // Check |bitmap| to make sure it has the right dimensions and content. static void CompareBitmap(FPDF_BITMAP bitmap, int expected_width, -- cgit v1.2.3