summaryrefslogtreecommitdiff
path: root/fpdfsdk
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 /fpdfsdk
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 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfsave_embeddertest.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfsave_embeddertest.cpp b/fpdfsdk/fpdfsave_embeddertest.cpp
index bbf7566b1c..e753ba0356 100644
--- a/fpdfsdk/fpdfsave_embeddertest.cpp
+++ b/fpdfsdk/fpdfsave_embeddertest.cpp
@@ -66,11 +66,11 @@ TEST_F(FPDFSaveEmbedderTest, SaveLinearizedDoc) {
EXPECT_TRUE(OpenDocument("linearized.pdf"));
for (int i = 0; i < kPageCount; ++i) {
FPDF_PAGE page = LoadPage(i);
- FPDF_BITMAP bitmap = RenderPageDeprecated(page);
- EXPECT_EQ(612, FPDFBitmap_GetWidth(bitmap));
- EXPECT_EQ(792, FPDFBitmap_GetHeight(bitmap));
- original_md5[i] = HashBitmap(bitmap);
- FPDFBitmap_Destroy(bitmap);
+ ASSERT_TRUE(page);
+ std::unique_ptr<void, FPDFBitmapDeleter> bitmap = RenderLoadedPage(page);
+ EXPECT_EQ(612, FPDFBitmap_GetWidth(bitmap.get()));
+ EXPECT_EQ(792, FPDFBitmap_GetHeight(bitmap.get()));
+ original_md5[i] = HashBitmap(bitmap.get());
UnloadPage(page);
}