1 // Copyright 2016 PDFium Authors. All rights reserved.
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 <memory>
6 
7 #include "public/cpp/fpdf_scopers.h"
8 #include "testing/embedder_test.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10 
11 class JBig2EmbedderTest : public EmbedderTest {};
12 
13 #if defined(_SKIA_SUPPORT_)
14 // TODO(crbug.com/pdfium/11): Fix this test and enable.
15 #define MAYBE_Bug_631912 DISABLED_Bug_631912
16 #else
17 #define MAYBE_Bug_631912 Bug_631912
18 #endif
TEST_F(JBig2EmbedderTest,MAYBE_Bug_631912)19 TEST_F(JBig2EmbedderTest, MAYBE_Bug_631912) {
20   // Test jbig2 image in PDF file can be loaded successfully.
21   // Should not crash.
22   EXPECT_TRUE(OpenDocument("bug_631912.pdf"));
23   FPDF_PAGE page = LoadPage(0);
24   ASSERT_TRUE(page);
25   ScopedFPDFBitmap bitmap = RenderLoadedPage(page);
26   CompareBitmap(bitmap.get(), 691, 432, "24d75af646f8772c5ee7ced260452ae4");
27   UnloadPage(page);
28 }
29