summaryrefslogtreecommitdiff
path: root/core/fpdfapi/edit
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-02-07 23:00:07 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-07 23:00:07 +0000
commit6183a6e7693b7aeb9763eaa130b43269b13a02d7 (patch)
tree713cb705473751210b1ec89d6a6f365f888f0d5e /core/fpdfapi/edit
parent9ad9a5fc81a36ab406ff49408dd0814d350bbc7e (diff)
downloadpdfium-6183a6e7693b7aeb9763eaa130b43269b13a02d7.tar.xz
Remove some deprecated RenderPage method usage.
Do some additional checks in test cases where pages were rendered but the resulting bitmap was immediately destroyed. Change-Id: I2f4678140cdc672ab4ced70f748135464447ff59 Reviewed-on: https://pdfium-review.googlesource.com/25510 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'core/fpdfapi/edit')
-rw-r--r--core/fpdfapi/edit/cpdf_creator_embeddertest.cpp9
1 files changed, 5 insertions, 4 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);
}