diff options
author | Lei Zhang <thestig@chromium.org> | 2018-02-07 23:00:07 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-07 23:00:07 +0000 |
commit | 6183a6e7693b7aeb9763eaa130b43269b13a02d7 (patch) | |
tree | 713cb705473751210b1ec89d6a6f365f888f0d5e /core/fxcodec/codec | |
parent | 9ad9a5fc81a36ab406ff49408dd0814d350bbc7e (diff) | |
download | pdfium-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/fxcodec/codec')
-rw-r--r-- | core/fxcodec/codec/fx_codec_embeddertest.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <memory> + #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<void, FPDFBitmapDeleter> bitmap = RenderLoadedPage(page); + CompareBitmap(bitmap.get(), 691, 432, "24d75af646f8772c5ee7ced260452ae4"); UnloadPage(page); } |