From 6183a6e7693b7aeb9763eaa130b43269b13a02d7 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Wed, 7 Feb 2018 23:00:07 +0000 Subject: 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 Commit-Queue: Lei Zhang --- fpdfsdk/fpdfsave_embeddertest.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fpdfsdk') 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 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); } -- cgit v1.2.3