Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: fpdfsdk/fsdk_baseform_embeddertest.cpp

Issue 2258333002: Fix page leaks in an embedder test (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: new approach Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/fpdfformfill_embeddertest.cpp ('k') | testing/embedder_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/fsdk_baseform_embeddertest.cpp
diff --git a/fpdfsdk/fsdk_baseform_embeddertest.cpp b/fpdfsdk/fsdk_baseform_embeddertest.cpp
index 622f1a8c04ce3ff5aeff1a3852f936c544e4bfea..7af8262c555e468f0e4bb34d6676d7f9d6441314 100644
--- a/fpdfsdk/fsdk_baseform_embeddertest.cpp
+++ b/fpdfsdk/fsdk_baseform_embeddertest.cpp
@@ -26,9 +26,12 @@ class FSDKBaseFormEmbeddertest : public EmbedderTest {};
TEST_F(FSDKBaseFormEmbeddertest, CBA_AnnotIterator) {
EXPECT_TRUE(OpenDocument("annotiter.pdf"));
- EXPECT_TRUE(LoadPage(0));
- EXPECT_TRUE(LoadPage(1));
- EXPECT_TRUE(LoadPage(2));
+ FPDF_PAGE page0 = LoadPage(0);
+ FPDF_PAGE page1 = LoadPage(1);
+ FPDF_PAGE page2 = LoadPage(2);
+ EXPECT_TRUE(page0);
+ EXPECT_TRUE(page1);
+ EXPECT_TRUE(page2);
CFX_FloatRect LeftBottom(200, 200, 220, 220);
CFX_FloatRect RightBottom(400, 201, 420, 221);
@@ -112,4 +115,7 @@ TEST_F(FSDKBaseFormEmbeddertest, CBA_AnnotIterator) {
pAnnot = iter.GetPrevAnnot(pAnnot);
EXPECT_EQ(iter.GetLastAnnot(), pAnnot);
}
+ UnloadPage(page2);
+ UnloadPage(page1);
+ UnloadPage(page0);
}
« no previous file with comments | « fpdfsdk/fpdfformfill_embeddertest.cpp ('k') | testing/embedder_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698