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

Side by Side Diff: fpdfsdk/fpdfdoc_unittest.cpp

Issue 2421603002: Reland: Make the CPDFXFA_App non-global (Closed)
Patch Set: Review feedback Created 4 years, 1 month 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
« no previous file with comments | « fpdfsdk/cpdfsdk_formfillenvironment.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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_doc.h" 5 #include "public/fpdf_doc.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "core/fpdfapi/cpdf_modulemgr.h" 10 #include "core/fpdfapi/cpdf_modulemgr.h"
(...skipping 17 matching lines...) Expand all
28 CPDF_TestDocument() : CPDF_Document(nullptr) {} 28 CPDF_TestDocument() : CPDF_Document(nullptr) {}
29 29
30 void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; } 30 void SetRoot(CPDF_Dictionary* root) { m_pRootDict = root; }
31 CPDF_IndirectObjectHolder* GetHolder() { return this; } 31 CPDF_IndirectObjectHolder* GetHolder() { return this; }
32 }; 32 };
33 33
34 #ifdef PDF_ENABLE_XFA 34 #ifdef PDF_ENABLE_XFA
35 class CPDF_TestXFADocument : public CPDFXFA_Document { 35 class CPDF_TestXFADocument : public CPDFXFA_Document {
36 public: 36 public:
37 CPDF_TestXFADocument() 37 CPDF_TestXFADocument()
38 : CPDFXFA_Document(pdfium::MakeUnique<CPDF_TestDocument>(), 38 : CPDFXFA_Document(pdfium::MakeUnique<CPDF_TestDocument>()) {}
39 CPDFXFA_App::GetInstance()) {}
40 39
41 void SetRoot(CPDF_Dictionary* root) { 40 void SetRoot(CPDF_Dictionary* root) {
42 reinterpret_cast<CPDF_TestDocument*>(GetPDFDoc())->SetRoot(root); 41 reinterpret_cast<CPDF_TestDocument*>(GetPDFDoc())->SetRoot(root);
43 } 42 }
44 43
45 CPDF_IndirectObjectHolder* GetHolder() { return GetPDFDoc(); } 44 CPDF_IndirectObjectHolder* GetHolder() { return GetPDFDoc(); }
46 }; 45 };
47 using CPDF_TestPdfDocument = CPDF_TestXFADocument; 46 using CPDF_TestPdfDocument = CPDF_TestXFADocument;
48 #else // PDF_ENABLE_XFA 47 #else // PDF_ENABLE_XFA
49 using CPDF_TestPdfDocument = CPDF_TestDocument; 48 using CPDF_TestPdfDocument = CPDF_TestDocument;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 // Title with no match. 224 // Title with no match.
226 std::unique_ptr<unsigned short, pdfium::FreeDeleter> title = 225 std::unique_ptr<unsigned short, pdfium::FreeDeleter> title =
227 GetFPDFWideString(L"Chapter 8"); 226 GetFPDFWideString(L"Chapter 8");
228 EXPECT_EQ(nullptr, FPDFBookmark_Find(m_pDoc.get(), title.get())); 227 EXPECT_EQ(nullptr, FPDFBookmark_Find(m_pDoc.get(), title.get()));
229 228
230 // Title with a match. 229 // Title with a match.
231 title = GetFPDFWideString(L"Chapter 3"); 230 title = GetFPDFWideString(L"Chapter 3");
232 EXPECT_EQ(bookmarks[3].obj, FPDFBookmark_Find(m_pDoc.get(), title.get())); 231 EXPECT_EQ(bookmarks[3].obj, FPDFBookmark_Find(m_pDoc.get(), title.get()));
233 } 232 }
234 } 233 }
OLDNEW
« no previous file with comments | « fpdfsdk/cpdfsdk_formfillenvironment.cpp ('k') | fpdfsdk/fpdfformfill.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698