From a98e36657d0e5a78e216f828b3e712e85250c1a7 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 7 Feb 2018 20:28:35 +0000 Subject: Clean up RenderPage methods in EmbedderTest. Add replacement methods that make themselves clear as to what they are rendering, and return unique_ptrs to help prevent leakage. Mark existing methods deprecated. Change-Id: I9055407e614dfbe765428fb32a7da64df3418d1d Reviewed-on: https://pdfium-review.googlesource.com/25470 Reviewed-by: dsinclair Commit-Queue: Lei Zhang --- core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp | 2 +- core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core/fpdfapi/parser') diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index cc29b8954e..6c1a0e9ae5 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -58,7 +58,7 @@ TEST_F(CPDFSecurityHandlerEmbeddertest, PasswordAfterGenerateSave) { EXPECT_TRUE(FPDFPath_SetFillColor(red_rect, 255, 0, 0, 255)); EXPECT_TRUE(FPDFPath_SetDrawMode(red_rect, FPDF_FILLMODE_ALTERNATE, 0)); FPDFPage_InsertObject(page, red_rect); - FPDF_BITMAP page_bitmap = RenderPage(page); + FPDF_BITMAP page_bitmap = RenderPageDeprecated(page); CompareBitmap(page_bitmap, 612, 792, md5); FPDFBitmap_Destroy(page_bitmap); EXPECT_TRUE(FPDFPage_GenerateContent(page)); diff --git a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp index e95a4cc595..20e8cf775c 100644 --- a/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp +++ b/core/fpdfapi/parser/fpdf_parser_decode_embeddertest.cpp @@ -93,7 +93,7 @@ TEST_F(FPDFParserDecodeEmbeddertest, Bug_552046) { // crash when rendered. EXPECT_TRUE(OpenDocument("bug_552046.pdf")); FPDF_PAGE page = LoadPage(0); - FPDF_BITMAP bitmap = RenderPage(page); + FPDF_BITMAP bitmap = RenderPageDeprecated(page); CompareBitmap(bitmap, 612, 792, "1940568c9ba33bac5d0b1ee9558c76b3"); FPDFBitmap_Destroy(bitmap); UnloadPage(page); @@ -104,7 +104,7 @@ TEST_F(FPDFParserDecodeEmbeddertest, Bug_555784) { // Should not cause a crash when rendered. EXPECT_TRUE(OpenDocument("bug_555784.pdf")); FPDF_PAGE page = LoadPage(0); - FPDF_BITMAP bitmap = RenderPage(page); + FPDF_BITMAP bitmap = RenderPageDeprecated(page); CompareBitmap(bitmap, 612, 792, "1940568c9ba33bac5d0b1ee9558c76b3"); FPDFBitmap_Destroy(bitmap); UnloadPage(page); @@ -115,7 +115,7 @@ TEST_F(FPDFParserDecodeEmbeddertest, Bug_455199) { // Should open successfully. EXPECT_TRUE(OpenDocument("bug_455199.pdf")); FPDF_PAGE page = LoadPage(0); - FPDF_BITMAP bitmap = RenderPage(page); + FPDF_BITMAP bitmap = RenderPageDeprecated(page); #if _FX_PLATFORM_ == _FX_PLATFORM_APPLE_ const char kExpectedMd5sum[] = "b90475ca64d1348c3bf5e2b77ad9187a"; #elif _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ -- cgit v1.2.3