summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfedit_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfedit_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfedit_embeddertest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 25377fe6f8..40081e6d75 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -15,6 +15,7 @@
#include "core/fxcrt/fx_system.h"
#include "fpdfsdk/fsdk_define.h"
#include "public/cpp/fpdf_deleters.h"
+#include "public/fpdf_annot.h"
#include "public/fpdf_edit.h"
#include "public/fpdfview.h"
#include "testing/embedder_test.h"
@@ -838,6 +839,23 @@ TEST_F(FPDFEditEmbeddertest, AddTrueTypeFontText) {
FPDF_CloseDocument(new_doc);
}
+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);
+ ASSERT_TRUE(page);
+
+ // Add an underline annotation to the page without specifying its rectangle.
+ FPDF_ANNOTATION annot;
+ ASSERT_TRUE(FPDFPage_CreateAnnot(page, FPDF_ANNOT_UNDERLINE, &annot));
+
+ // FPDFPage_TransformAnnots() should run without errors when modifying
+ // annotation rectangles.
+ FPDFPage_TransformAnnots(page, 1, 2, 3, 4, 5, 6);
+
+ UnloadPage(page);
+}
+
// TODO(npm): Add tests using Japanese fonts in other OS.
#if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_
TEST_F(FPDFEditEmbeddertest, AddCIDFontText) {