xref: /aosp_15_r20/external/pdfium/core/fxcodec/jbig2/jbig2_embeddertest.cpp (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2016 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "public/cpp/fpdf_scopers.h"
6 #include "testing/embedder_test.h"
7 #include "testing/gtest/include/gtest/gtest.h"
8 
9 class JBig2EmbedderTest : public EmbedderTest {};
10 
11 #if defined(_SKIA_SUPPORT_)
12 // TODO(crbug.com/pdfium/11): Fix this test and enable.
13 #define MAYBE_Bug_631912 DISABLED_Bug_631912
14 #else
15 #define MAYBE_Bug_631912 Bug_631912
16 #endif
TEST_F(JBig2EmbedderTest,MAYBE_Bug_631912)17 TEST_F(JBig2EmbedderTest, MAYBE_Bug_631912) {
18   // Test jbig2 image in PDF file can be loaded successfully.
19   // Should not crash.
20   ASSERT_TRUE(OpenDocument("bug_631912.pdf"));
21   FPDF_PAGE page = LoadPage(0);
22   ASSERT_TRUE(page);
23   ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
24   CompareBitmap(bitmap.get(), 691, 432, "726c2b8c89df0ab40627322d1dddd521");
25   UnloadPage(page);
26 }
27