summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot_embeddertest.cpp
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-03-15 15:25:16 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-15 15:25:16 +0000
commit35841fa4e3dbf8f9146f78def048c4a287894a8a (patch)
tree2252389ad952f6bdb0c9a55b6441f3b195e38ff3 /fpdfsdk/fpdfannot_embeddertest.cpp
parentd14dd4316d04f0982c340ad25bb283198a4d5c32 (diff)
downloadpdfium-35841fa4e3dbf8f9146f78def048c4a287894a8a.tar.xz
Create FPDFPage_RemoveObject().
This call removes a page object from a page. We currently offer an API to insert these objects, but not to remove. Bug: pdfium:1037 Change-Id: I35ff596f9e7c87a39051f0cb1de40a5bec40fee5 Reviewed-on: https://pdfium-review.googlesource.com/28492 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfannot_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfannot_embeddertest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp
index 70e184dd41..4e32b19ff9 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdfannot_embeddertest.cpp
@@ -575,6 +575,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) {
// Check that this annotation has one path object and retrieve it.
EXPECT_EQ(1, FPDFAnnot_GetObjectCount(annot.get()));
+ ASSERT_EQ(32, FPDFPage_CountObjects(page));
FPDF_PAGEOBJECT path = FPDFAnnot_GetObject(annot.get(), 1);
EXPECT_FALSE(path);
path = FPDFAnnot_GetObject(annot.get(), 0);
@@ -601,6 +602,10 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) {
EXPECT_TRUE(FPDFAnnot_AppendObject(annot.get(), dot));
EXPECT_EQ(2, FPDFAnnot_GetObjectCount(annot.get()));
+ // The object is in the annontation, not in the page, so the page object
+ // array should not change.
+ ASSERT_EQ(32, FPDFPage_CountObjects(page));
+
// Check that the page with an annotation with two paths renders correctly.
{
std::unique_ptr<void, FPDFBitmapDeleter> bitmap =
@@ -611,6 +616,7 @@ TEST_F(FPDFAnnotEmbeddertest, AddAndModifyPath) {
// Delete the newly added path object.
EXPECT_TRUE(FPDFAnnot_RemoveObject(annot.get(), 1));
EXPECT_EQ(1, FPDFAnnot_GetObjectCount(annot.get()));
+ ASSERT_EQ(32, FPDFPage_CountObjects(page));
}
// Check that the page renders the same as before.