1 // Copyright 2019 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 "testing/embedder_test.h"
6 #include "testing/gtest/include/gtest/gtest.h"
7
8 class CXFALayoutItemEmbedderTest : public EmbedderTest {};
9
10 #if defined(LEAK_SANITIZER)
11
12 // Leaks. See https://crbug.com/pdfium/1301
13 #define MAYBE_Bug_1301 DISABLED_Bug_1301
14
15 #else
16 #define MAYBE_Bug_1301 Bug_1301
17 #endif
18
TEST_F(CXFALayoutItemEmbedderTest,Bug_1265)19 TEST_F(CXFALayoutItemEmbedderTest, Bug_1265) {
20 EXPECT_TRUE(OpenDocument("bug_1265.pdf"));
21 FPDF_PAGE page0 = LoadPage(0);
22 FPDF_PAGE page1 = LoadPage(1);
23 EXPECT_NE(nullptr, page0);
24 EXPECT_EQ(nullptr, page1);
25 UnloadPage(page0);
26 }
27
TEST_F(CXFALayoutItemEmbedderTest,MAYBE_Bug_1301)28 TEST_F(CXFALayoutItemEmbedderTest, MAYBE_Bug_1301) {
29 EXPECT_TRUE(OpenDocument("bug_1301.pdf"));
30 FPDF_PAGE page0 = LoadPage(0);
31 FPDF_PAGE page1 = LoadPage(1);
32 FPDF_PAGE page2 = LoadPage(2);
33 EXPECT_NE(nullptr, page0);
34 EXPECT_NE(nullptr, page1);
35 EXPECT_EQ(nullptr, page2);
36 UnloadPage(page0);
37 UnloadPage(page1);
38 }
39
TEST_F(CXFALayoutItemEmbedderTest,Bug_306123)40 TEST_F(CXFALayoutItemEmbedderTest, Bug_306123) {
41 EXPECT_TRUE(OpenDocument("bug_306123.pdf"));
42 FPDF_PAGE page0 = LoadPage(0);
43 FPDF_PAGE page1 = LoadPage(1);
44 FPDF_PAGE page2 = LoadPage(2);
45 EXPECT_NE(nullptr, page0);
46 EXPECT_NE(nullptr, page1);
47 EXPECT_EQ(nullptr, page2);
48 UnloadPage(page0);
49 UnloadPage(page1);
50 }
51