diff options
author | Lei Zhang <thestig@chromium.org> | 2017-03-24 15:52:00 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-27 14:47:23 +0000 |
commit | 0d6d1783ed96ae25cf5d0fb83d13ba1e7421a6cd (patch) | |
tree | b7bcc3bba0694de3cbfd1f422a1f71e546f1ab8a | |
parent | 8e3f692b03e97659e855be4ea7c7b45d1c0f20c5 (diff) | |
download | pdfium-0d6d1783ed96ae25cf5d0fb83d13ba1e7421a6cd.tar.xz |
Remove old test expectations after the Mac 10.12 upgrade.
BUG=chromium:703912
Change-Id: I5b4e582afc95b845e8e5e7a4e14581127c18de2d
Reviewed-on: https://pdfium-review.googlesource.com/3193
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: Nicolás Peña <npm@chromium.org>
-rw-r--r-- | core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/fpdfedit_embeddertest.cpp | 24 | ||||
-rw-r--r-- | testing/embedder_test.cpp | 22 | ||||
-rw-r--r-- | testing/embedder_test.h | 8 |
4 files changed, 9 insertions, 48 deletions
diff --git a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp index 9dfc26e369..b1acd16ef3 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp @@ -115,8 +115,7 @@ TEST_F(FPDFParserDecodeEmbeddertest, Bug_455199) { FPDF_PAGE page = LoadPage(0); FPDF_BITMAP bitmap = RenderPage(page); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - // Rendering on Mac is inconsistent, so skip this check. - const char* const kExpectedMd5sum = nullptr; + const char kExpectedMd5sum[] = "b90475ca64d1348c3bf5e2b77ad9187a"; #else const char kExpectedMd5sum[] = "6f9f0fd903da177babb24dd50a806a56"; #endif diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 19bdaf57ee..46eab096cd 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -364,13 +364,11 @@ TEST_F(FPDFEditEmbeddertest, PathOnTopOfText) { // Render and check the result. Text is slightly different on Mac. FPDF_BITMAP bitmap = RenderPage(page); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - const char md5[] = "2f7c0deee10a9490538e195af64beb67"; - const char new_md5[] = "f9e6fa74230f234286bfcada9f7606d8"; - CompareBitmap2Options(bitmap, 200, 200, md5, new_md5); + const char md5[] = "f9e6fa74230f234286bfcada9f7606d8"; #else const char md5[] = "17c942c76ff229200f2c98073bb60d85"; - CompareBitmap(bitmap, 200, 200, md5); #endif + CompareBitmap(bitmap, 200, 200, md5); FPDFBitmap_Destroy(bitmap); UnloadPage(page); } @@ -437,13 +435,11 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); FPDF_BITMAP page_bitmap = RenderPage(page); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - const char md5[] = "e19c90395d73cb9f37a6c3b0e8b18a9e"; - const char new_md5[] = "a4dddc1a3930fa694bbff9789dab4161"; - CompareBitmap2Options(page_bitmap, 612, 792, md5, new_md5); + const char md5[] = "a4dddc1a3930fa694bbff9789dab4161"; #else const char md5[] = "7c3a36ba7cec01688a16a14bfed9ecfc"; - CompareBitmap(page_bitmap, 612, 792, md5); #endif + CompareBitmap(page_bitmap, 612, 792, md5); FPDFBitmap_Destroy(page_bitmap); // Try another font @@ -456,13 +452,11 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); page_bitmap = RenderPage(page); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - const char md5_2[] = "8e1c43dca6be68d364dbc283f5521041"; - const char new_md5_2[] = "a5c4ace4c6f27644094813fe1441a21c"; - CompareBitmap2Options(page_bitmap, 612, 792, md5_2, new_md5_2); + const char md5_2[] = "a5c4ace4c6f27644094813fe1441a21c"; #else const char md5_2[] = "e0e0873e3a2634a6394a431a51ce90ff"; - CompareBitmap(page_bitmap, 612, 792, md5_2); #endif + CompareBitmap(page_bitmap, 612, 792, md5_2); FPDFBitmap_Destroy(page_bitmap); // And some randomly transformed text @@ -475,13 +469,11 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) { EXPECT_TRUE(FPDFPage_GenerateContent(page)); page_bitmap = RenderPage(page); #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ - const char md5_3[] = "c6e5df448428793c7e4b0c820bd8c85e"; - const char new_md5_3[] = "40b3ef04f915ff4c4208948001763544"; - CompareBitmap2Options(page_bitmap, 612, 792, md5_3, new_md5_3); + const char md5_3[] = "40b3ef04f915ff4c4208948001763544"; #else const char md5_3[] = "903ee10b6a9f0be51ecad0a1a0eeb171"; - CompareBitmap(page_bitmap, 612, 792, md5_3); #endif + CompareBitmap(page_bitmap, 612, 792, md5_3); FPDFBitmap_Destroy(page_bitmap); // TODO(npm): Why are there issues with text rotated by 90 degrees? diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp index 5d906fe503..79074153fb 100644 --- a/testing/embedder_test.cpp +++ b/testing/embedder_test.cpp @@ -355,28 +355,6 @@ 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) { diff --git a/testing/embedder_test.h b/testing/embedder_test.h index f341acf688..619fc5d699 100644 --- a/testing/embedder_test.h +++ b/testing/embedder_test.h @@ -114,14 +114,6 @@ class EmbedderTest : public ::testing::Test, int expected_height, const char* expected_md5sum); - // Check |bitmap| to make sure it has the right dimensions and content. - // Have two options for the expected md5 sum. - static void CompareBitmap2Options(FPDF_BITMAP bitmap, - int expected_width, - int expected_height, - const char* option1_md5sum, - const char* option2_md5sum); - Delegate* delegate_; std::unique_ptr<Delegate> default_delegate_; FPDF_DOCUMENT document_; |