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

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

Issue 2005653002: Distinguish between user and owner passwords. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 6 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 "public/fpdf_text.h"
6 #include "testing/embedder_test.h" 6 #include "testing/embedder_test.h"
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 class CPDFParserEmbeddertest : public EmbedderTest {}; 9 class CPDFParserEmbeddertest : public EmbedderTest {};
10 10
(...skipping 14 matching lines...) Expand all
25 TEST_F(CPDFParserEmbeddertest, Bug_544880) { 25 TEST_F(CPDFParserEmbeddertest, Bug_544880) {
26 // Test self referencing /Pages object. 26 // Test self referencing /Pages object.
27 EXPECT_TRUE(OpenDocument("bug_544880.pdf")); 27 EXPECT_TRUE(OpenDocument("bug_544880.pdf"));
28 // Shouldn't crash. We don't check the return value here because we get the 28 // Shouldn't crash. We don't check the return value here because we get the
29 // the count from the "/Count 1" in the testcase (at the time of writing) 29 // the count from the "/Count 1" in the testcase (at the time of writing)
30 // rather than the actual count (0). 30 // rather than the actual count (0).
31 (void)GetPageCount(); 31 (void)GetPageCount();
32 } 32 }
33 33
34 TEST_F(CPDFParserEmbeddertest, Feature_Linearized_Loading) { 34 TEST_F(CPDFParserEmbeddertest, Feature_Linearized_Loading) {
35 EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", true)); 35 EXPECT_TRUE(OpenDocument("feature_linearized_loading.pdf", nullptr, true));
36 } 36 }
37 37
38 TEST_F(CPDFParserEmbeddertest, Bug_325) { 38 TEST_F(CPDFParserEmbeddertest, Bug_325) {
39 EXPECT_FALSE(OpenDocument("bug_325_a.pdf")); 39 EXPECT_FALSE(OpenDocument("bug_325_a.pdf"));
40 EXPECT_FALSE(OpenDocument("bug_325_b.pdf")); 40 EXPECT_FALSE(OpenDocument("bug_325_b.pdf"));
41 } 41 }
42 42
43 TEST_F(CPDFParserEmbeddertest, Bug_602650) { 43 TEST_F(CPDFParserEmbeddertest, Bug_602650) {
44 // Test the case that cross reference entries, which are well formed, 44 // Test the case that cross reference entries, which are well formed,
45 // but do not match with the objects. 45 // but do not match with the objects.
46 EXPECT_TRUE(OpenDocument("bug_602650.pdf")); 46 EXPECT_TRUE(OpenDocument("bug_602650.pdf"));
47 FPDF_PAGE page = LoadPage(0); 47 FPDF_PAGE page = LoadPage(0);
48 EXPECT_NE(nullptr, page); 48 EXPECT_NE(nullptr, page);
49 FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page); 49 FPDF_TEXTPAGE text_page = FPDFText_LoadPage(page);
50 EXPECT_NE(nullptr, text_page); 50 EXPECT_NE(nullptr, text_page);
51 // The page should not be blank. 51 // The page should not be blank.
52 EXPECT_LT(0, FPDFText_CountChars(text_page)); 52 EXPECT_LT(0, FPDFText_CountChars(text_page));
53 53
54 FPDFText_ClosePage(text_page); 54 FPDFText_ClosePage(text_page);
55 UnloadPage(page); 55 UnloadPage(page);
56 } 56 }
OLDNEW
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_parser.cpp ('k') | core/fpdfapi/fpdf_parser/cpdf_security_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698