summaryrefslogtreecommitdiff
path: root/testing/embedder_test.cpp
diff options
context:
space:
mode:
authorNicolas Pena <npm@chromium.org>2017-03-22 11:04:35 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-22 15:35:34 +0000
commit5bcd9a32232e8cd5df918104eb131be76f833701 (patch)
tree08db8fc6fbe874ac106d72457279cea2cc3aed0d /testing/embedder_test.cpp
parent742fa8c3b39f0e3713c3450b1f9979174fbb4c8f (diff)
downloadpdfium-5bcd9a32232e8cd5df918104eb131be76f833701.tar.xz
Fix Mac tests on 10.12
md5's with text are changed, so need to allow both the previous and the new one. Pixel tests with text also fail on 10.12, so suppressing those. Found many unexpected successes, so will unsuppress those once all bots are 10.12 BUG=chromium:703912 Change-Id: I6b34aa2f581eb8ea705f3876960b49c89e249347 Reviewed-on: https://pdfium-review.googlesource.com/3144 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'testing/embedder_test.cpp')
-rw-r--r--testing/embedder_test.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index 79074153fb..5d906fe503 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -355,6 +355,28 @@ void EmbedderTest::CompareBitmap(FPDF_BITMAP bitmap,
EXPECT_EQ(expected_md5sum, CRYPT_ToBase16(digest));
}
+// static
+void EmbedderTest::CompareBitmap2Options(FPDF_BITMAP bitmap,
+ int expected_width,
+ int expected_height,
+ const char* option1_md5sum,
+ const char* option2_md5sum) {
+ ASSERT_EQ(expected_width, FPDFBitmap_GetWidth(bitmap));
+ ASSERT_EQ(expected_height, FPDFBitmap_GetHeight(bitmap));
+ const int expected_stride = expected_width * 4;
+ ASSERT_EQ(expected_stride, FPDFBitmap_GetStride(bitmap));
+
+ if (!option1_md5sum || !option2_md5sum)
+ return;
+
+ uint8_t digest[16];
+ CRYPT_MD5Generate(static_cast<uint8_t*>(FPDFBitmap_GetBuffer(bitmap)),
+ expected_stride * expected_height, digest);
+ std::string digest_string = CRYPT_ToBase16(digest);
+ EXPECT_TRUE(digest_string == option1_md5sum ||
+ digest_string == option2_md5sum);
+}
+
// Can't use gtest-provided main since we need to stash the path to the
// executable in order to find the external V8 binary data files.
int main(int argc, char** argv) {