summaryrefslogtreecommitdiff
path: root/core/fxge
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/fxge
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/fxge')
-rw-r--r--core/fxge/fx_ge_text_embeddertest.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/core/fxge/fx_ge_text_embeddertest.cpp b/core/fxge/fx_ge_text_embeddertest.cpp
index 7aeb3f3e07..362ccf5dc1 100644
--- a/core/fxge/fx_ge_text_embeddertest.cpp
+++ b/core/fxge/fx_ge_text_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"
@@ -11,8 +13,9 @@ TEST_F(FXGETextEmbedderTest, BadItalic) {
// Shouldn't crash.
EXPECT_TRUE(OpenDocument("bug_601362.pdf"));
FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
- FPDF_BITMAP bitmap = RenderPageDeprecated(page);
- 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()));
UnloadPage(page);
}