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 <dsinclair@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
diff --git a/fpdfsdk/fpdfedit_embeddertest.cpp b/fpdfsdk/fpdfedit_embeddertest.cpp
index 8c97d42..8754a66 100644
--- a/fpdfsdk/fpdfedit_embeddertest.cpp
+++ b/fpdfsdk/fpdfedit_embeddertest.cpp
@@ -1122,6 +1122,26 @@
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<void, FPDFBitmapDeleter> bitmap(
+ FPDFImageObj_GetBitmap(obj));
+ ASSERT_FALSE(bitmap);
+ }
+
+ UnloadPage(page);
+}
+
TEST_F(FPDFEditEmbeddertest, GetImageData) {
EXPECT_TRUE(OpenDocument("embedded_images.pdf"));
FPDF_PAGE page = LoadPage(0);