diff options
author | Lei Zhang <thestig@chromium.org> | 2018-02-08 17:22:39 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-02-08 17:22:39 +0000 |
commit | 75c81710b1d193b59d5b38142bb926959346f7ea (patch) | |
tree | 814b91fec0f7a7b09c93b230e9f0663a76e05d27 /fpdfsdk/fpdfedit_embeddertest.cpp | |
parent | b0fb8cc23c0ae555726f873101961676f96f6f07 (diff) | |
download | pdfium-75c81710b1d193b59d5b38142bb926959346f7ea.tar.xz |
Do more page load/unload checks in EmbedderTest.
- Keep track of pages in a single map when calling LoadPage(). It is
simpler and performance is not crucial as the number of loaded pages
is usually very small.
- Verify UnloadPage() is only called for loaded pages.
- Verify there are no loaded pages in TearDown().
- Verify RenderLoadedPage methods are only rendering loaded pages.
- Fix pages that are using FPDF_LoadPage() and FPDF_ClosePage() when
they should be using LoadPage() and UnloadPage().
- Disallow calling LoadPage() for the same page number repeatedly. No
caller does this and it makes verification in UnloadPage() harder.
Change-Id: I58878ea8ade21dde28f1bbebd3a3304ce677561d
Reviewed-on: https://pdfium-review.googlesource.com/25550
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdfedit_embeddertest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index f388107708..f27cf747c1 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -926,7 +926,7 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) { TEST_F(FPDFEditEmbeddertest, TransformAnnot) { // Open a file with one annotation and load its first page. ASSERT_TRUE(OpenDocument("annotation_highlight_long_content.pdf")); - FPDF_PAGE page = FPDF_LoadPage(document(), 0); + FPDF_PAGE page = LoadPage(0); ASSERT_TRUE(page); { |