summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
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/parser
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/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_security_handler_embeddertest.cpp6
1 files changed, 3 insertions, 3 deletions
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));