diff options
Diffstat (limited to 'core/fpdfapi')
-rw-r--r-- | core/fpdfapi/edit/cpdf_creator_embeddertest.cpp | 9 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp | 6 |
2 files changed, 8 insertions, 7 deletions
diff --git a/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp b/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp index 7d1fb30595..86cd67b121 100644 --- a/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp +++ b/core/fpdfapi/edit/cpdf_creator_embeddertest.cpp @@ -25,11 +25,12 @@ TEST_F(CPDF_CreatorEmbedderTest, SavedDocsAreEqualAfterParse) { { // Do some read only operations. ASSERT_GE(1, FPDF_GetPageCount(document())); - FPDF_PAGE page = FPDF_LoadPage(document(), 0); + FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); - FPDF_BITMAP new_bitmap = - RenderPageWithFlagsDeprecated(page, form_handle(), FPDF_ANNOT); - FPDFBitmap_Destroy(new_bitmap); + std::unique_ptr<void, FPDFBitmapDeleter> bitmap = + RenderLoadedPageWithFlags(page, FPDF_ANNOT); + EXPECT_EQ(595, FPDFBitmap_GetWidth(bitmap.get())); + EXPECT_EQ(842, FPDFBitmap_GetHeight(bitmap.get())); UnloadPage(page); } diff --git a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp index 6c1a0e9ae5..df7b5b6873 100644 --- a/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <memory> #include <string> #include "core/fxcrt/fx_system.h" @@ -58,9 +59,8 @@ 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 = RenderPageDeprecated(page); - CompareBitmap(page_bitmap, 612, 792, md5); - FPDFBitmap_Destroy(page_bitmap); + std::unique_ptr<void, FPDFBitmapDeleter> bitmap = RenderLoadedPage(page); + CompareBitmap(bitmap.get(), 612, 792, md5); EXPECT_TRUE(FPDFPage_GenerateContent(page)); SetWholeFileAvailable(); EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0)); |