Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: core/fpdfapi/fpdf_parser/cpdf_parser_embeddertest.cpp

Issue 1910063004: Add a simple check for V4 cross reference table (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: address comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_parser/include/cpdf_parser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698