From 53341dd518f1b6f2969529dd62ccd6e605af182b Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 1 Mar 2018 15:42:47 +0000 Subject: Add a test for FPDFImageObj_GetBitmap() with a JBIG image. The test expectations are for the current failure state. BUG=pdfium:945 Change-Id: I1be503860b2ad5cbb0466793c9fa1438b3fc43d7 Reviewed-on: https://pdfium-review.googlesource.com/27770 Reviewed-by: dsinclair Commit-Queue: dsinclair --- fpdfsdk/fpdfedit_embeddertest.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp index 8c97d42365..8754a665f7 100644 --- a/fpdfsdk/fpdfedit_embeddertest.cpp +++ b/fpdfsdk/fpdfedit_embeddertest.cpp @@ -1122,6 +1122,26 @@ TEST_F(FPDFEditEmbeddertest, ExtractImageBitmap) { UnloadPage(page); } +TEST_F(FPDFEditEmbeddertest, ExtractJBigImageBitmap) { + ASSERT_TRUE(OpenDocument("bug_631912.pdf")); + FPDF_PAGE page = LoadPage(0); + ASSERT_TRUE(page); + ASSERT_EQ(1, FPDFPage_CountObjects(page)); + + FPDF_PAGEOBJECT obj = FPDFPage_GetObject(page, 0); + ASSERT_EQ(FPDF_PAGEOBJ_IMAGE, FPDFPageObj_GetType(obj)); + { + // TODO(bug_945): This should return a valid bitmap. This test should be + // able to successfully check |bitmap| using FPDFBitmap_GetFormat() and + // CompareBitmap(). + std::unique_ptr bitmap( + FPDFImageObj_GetBitmap(obj)); + ASSERT_FALSE(bitmap); + } + + UnloadPage(page); +} + TEST_F(FPDFEditEmbeddertest, GetImageData) { EXPECT_TRUE(OpenDocument("embedded_images.pdf")); FPDF_PAGE page = LoadPage(0); -- cgit v1.2.3