summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfannot_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfannot_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfannot_embeddertest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfannot_embeddertest.cpp b/fpdfsdk/fpdfannot_embeddertest.cpp
index 85f9b68240..b7dee88b78 100644
--- a/fpdfsdk/fpdfannot_embeddertest.cpp
+++ b/fpdfsdk/fpdfannot_embeddertest.cpp
@@ -13,6 +13,23 @@
class FPDFAnnotEmbeddertest : public EmbedderTest, public TestSaver {};
+TEST_F(FPDFAnnotEmbeddertest, RenderAnnotWithOnlyRolloverAP) {
+ // Open a file with one annotation and load its first page.
+ ASSERT_TRUE(OpenDocument("annotation_highlight_rollover_ap.pdf"));
+ FPDF_PAGE page = FPDF_LoadPage(document(), 0);
+ ASSERT_TRUE(page);
+
+ // This annotation has a malformed appearance stream, which does not have its
+ // normal appearance defined, only its rollover appearance. In this case, its
+ // normal appearance should be generated, allowing the highlight annotation to
+ // still display.
+ FPDF_BITMAP bitmap = RenderPageWithFlags(page, FPDF_ANNOT);
+ CompareBitmap(bitmap, 612, 792, "dc98f06da047bd8aabfa99562d2cbd1e");
+ FPDFBitmap_Destroy(bitmap);
+
+ UnloadPage(page);
+}
+
TEST_F(FPDFAnnotEmbeddertest, ExtractHighlightLongContent) {
// Open a file with one annotation and load its first page.
ASSERT_TRUE(OpenDocument("annotation_highlight_long_content.pdf"));