| OLD | NEW |
| 1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "public/fpdf_text.h" |
| 5 #include "testing/embedder_test.h" | 6 #include "testing/embedder_test.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 8 |
| 8 class CPDFParserEmbeddertest : public EmbedderTest {}; | 9 class CPDFParserEmbeddertest : public EmbedderTest {}; |
| 9 | 10 |
| 10 TEST_F(CPDFParserEmbeddertest, LoadError_454695) { | 11 TEST_F(CPDFParserEmbeddertest, LoadError_454695) { |
| 11 // Test a dictionary with hex string instead of correct content. | 12 // Test a dictionary with hex string instead of correct content. |
| 12 // Verify that the defective pdf shouldn't be opened correctly. | 13 // Verify that the defective pdf shouldn't be opened correctly. |
| 13 EXPECT_FALSE(OpenDocument("bug_454695.pdf")); | 14 EXPECT_FALSE(OpenDocument("bug_454695.pdf")); |
| 14 } | 15 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 31 } | 32 } |
| 32 | 33 |
| 33 TEST_F(CPDFParserEmbeddertest, Feature_Linearized_Loading) { | 34 TEST_F(CPDFParserEmbeddertest, Feature_Linearized_Loading) { |
| 34 EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", true)); | 35 EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", true)); |
| 35 } | 36 } |
| 36 | 37 |
| 37 TEST_F(CPDFParserEmbeddertest, Bug_325) { | 38 TEST_F(CPDFParserEmbeddertest, Bug_325) { |
| 38 EXPECT_FALSE(OpenDocument("bug_325_a.pdf")); | 39 EXPECT_FALSE(OpenDocument("bug_325_a.pdf")); |
| 39 EXPECT_FALSE(OpenDocument("bug_325_b.pdf")); | 40 EXPECT_FALSE(OpenDocument("bug_325_b.pdf")); |
| 40 } | 41 } |
| 42 |
| 43 TEST_F(CPDFParserEmbeddertest, Bug_602650) { |
| 44 // Test the case that cross reference entries, which are well formed, |
| 45 // but do not match with the objects. |
| 46 EXPECT_TRUE(OpenDocument("bug_602650.pdf")); |
| 47 FPDF_PAGE page = LoadPage(0); |
| 48 EXPECT_NE(nullptr, page); |
| 49 FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page); |
| 50 EXPECT_NE(nullptr, text_page); |
| 51 // The page should not be blank. |
| 52 EXPECT_LT(0, FPDFText_CountChars(text_page)); |
| 53 |
| 54 FPDFText_ClosePage(text_page); |
| 55 UnloadPage(page); |
| 56 } |
| OLD | NEW |