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 --- core/fxcodec/codec/fx_codec_embeddertest.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/fxcodec/codec/fx_codec_embeddertest.cpp') diff --git a/core/fxcodec/codec/fx_codec_embeddertest.cpp b/core/fxcodec/codec/fx_codec_embeddertest.cpp index 50a15c3dc2..40a1662839 100644 --- a/core/fxcodec/codec/fx_codec_embeddertest.cpp +++ b/core/fxcodec/codec/fx_codec_embeddertest.cpp @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include + #include "testing/embedder_test.h" #include "testing/gtest/include/gtest/gtest.h" @@ -12,9 +14,8 @@ TEST_F(FXCodecEmbeddertest, Bug_631912) { // Should not crash. EXPECT_TRUE(OpenDocument("bug_631912.pdf")); FPDF_PAGE page = LoadPage(0); - EXPECT_NE(nullptr, page); - FPDF_BITMAP bitmap = RenderPageDeprecated(page); - CompareBitmap(bitmap, 691, 432, "24d75af646f8772c5ee7ced260452ae4"); - FPDFBitmap_Destroy(bitmap); + ASSERT_TRUE(page); + std::unique_ptr bitmap = RenderLoadedPage(page); + CompareBitmap(bitmap.get(), 691, 432, "24d75af646f8772c5ee7ced260452ae4"); UnloadPage(page); } -- cgit v1.2.3