summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot_embeddertest.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-06-20 16:47:41 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-06-20 21:04:49 +0000
commite10509a3d2a1641984845d579963d574305ea6cc (patch)
tree4a18e88dfd833279e2bd22590f16a317f4c6e812 /fpdfsdk/fpdfannot_embeddertest.cpp
parentd5a13afe9265463a497db40d8c66a8a736a86bc2 (diff)
downloadpdfium-e10509a3d2a1641984845d579963d574305ea6cc.tar.xz
Wrapper class for annotation dictionary + CPDF_Formchromium/3137
Simple wrapper class for annotation + its path parsing form object. This will be used in APIs for extracting and setting annotation paths. Bug=pdfium:737 Change-Id: I2e8131672d087613213735295c6d01e377b956e7 Reviewed-on: https://pdfium-review.googlesource.com/6730 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfannot_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfannot_embeddertest.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp
index e1da7cc2cd..85f9b68240 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdfannot_embeddertest.cpp
@@ -88,6 +88,7 @@ TEST_F(FPDFAnnotEmbeddertest, ExtractHighlightLongContent) {
EXPECT_EQ(157.211182f, quadpoints.x4);
EXPECT_EQ(706.264465f, quadpoints.y4);
+ FPDFPage_CloseAnnot(annot);
UnloadPage(page);
}
@@ -130,6 +131,7 @@ TEST_F(FPDFAnnotEmbeddertest, ExtractInkMultiple) {
EXPECT_EQ(475.336090f, rect.right);
EXPECT_EQ(681.535034f, rect.top);
+ FPDFPage_CloseAnnot(annot);
UnloadPage(page);
}
@@ -162,6 +164,8 @@ TEST_F(FPDFAnnotEmbeddertest, AddFirstTextAnnotation) {
// Check that the subtype of the annotation is correct.
EXPECT_EQ(FPDF_ANNOT_TEXT, FPDFAnnot_GetSubtype(annot));
+ FPDFPage_CloseAnnot(annot);
+
ASSERT_TRUE(FPDFPage_GetAnnot(page, 0, &annot));
EXPECT_EQ(FPDF_ANNOT_TEXT, FPDFAnnot_GetSubtype(annot));
@@ -222,6 +226,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddFirstTextAnnotation) {
GetPlatformWString(reinterpret_cast<unsigned short*>(buf.data()))
.c_str());
+ FPDFPage_CloseAnnot(annot);
UnloadPage(page);
}
@@ -242,12 +247,14 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) {
EXPECT_EQ(718.913940f, quadpoints.y1);
EXPECT_EQ(157.211182f, quadpoints.x4);
EXPECT_EQ(706.264465f, quadpoints.y4);
+ FPDFPage_CloseAnnot(annot);
// Add an underline annotation to the page and set its quadpoints.
ASSERT_TRUE(FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE, &annot));
quadpoints.x1 = 140.802643f;
quadpoints.x3 = 140.802643f;
ASSERT_TRUE(FPDFAnnot_SetAttachmentPoints(annot, quadpoints));
+ FPDFPage_CloseAnnot(annot);
// Save the document, closing the page and document.
EXPECT_TRUE(FPDF_SaveAsCopy(document(), this, 0));
@@ -280,6 +287,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndSaveUnderlineAnnotation) {
EXPECT_NEAR(quadpoints.x4, new_quadpoints.x4, 0.001f);
EXPECT_NEAR(quadpoints.y4, new_quadpoints.y4, 0.001f);
+ FPDFPage_CloseAnnot(new_annot);
FPDF_ClosePage(new_page);
FPDF_CloseDocument(new_doc);
}