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

Side by Side Diff: core/fpdfapi/parser/cpdf_document_unittest.cpp

Issue 2482973002: Rename CPDF_Linearized to CPDF_LinearizedHeader (Closed)
Patch Set: Remove if 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
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 "core/fpdfapi/parser/cpdf_document.h" 5 #include "core/fpdfapi/parser/cpdf_document.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "core/fpdfapi/cpdf_modulemgr.h" 9 #include "core/fpdfapi/cpdf_modulemgr.h"
10 #include "core/fpdfapi/parser/cpdf_array.h" 10 #include "core/fpdfapi/parser/cpdf_array.h"
11 #include "core/fpdfapi/parser/cpdf_dictionary.h" 11 #include "core/fpdfapi/parser/cpdf_dictionary.h"
12 #include "core/fpdfapi/parser/cpdf_linearized.h" 12 #include "core/fpdfapi/parser/cpdf_linearized_header.h"
13 #include "core/fpdfapi/parser/cpdf_parser.h" 13 #include "core/fpdfapi/parser/cpdf_parser.h"
14 #include "core/fxcrt/fx_memory.h" 14 #include "core/fxcrt/fx_memory.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace { 17 namespace {
18 18
19 CPDF_Dictionary* CreatePageTreeNode(CPDF_Array* kids, 19 CPDF_Dictionary* CreatePageTreeNode(CPDF_Array* kids,
20 CPDF_Document* pDoc, 20 CPDF_Document* pDoc,
21 int count) { 21 int count) {
22 CPDF_Dictionary* pageNode = new CPDF_Dictionary(); 22 CPDF_Dictionary* pageNode = new CPDF_Dictionary();
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 m_pOwnedRootDict.reset(new CPDF_Dictionary()); 69 m_pOwnedRootDict.reset(new CPDF_Dictionary());
70 m_pOwnedRootDict->SetReferenceFor("Pages", this, pagesDict->GetObjNum()); 70 m_pOwnedRootDict->SetReferenceFor("Pages", this, pagesDict->GetObjNum());
71 m_pRootDict = m_pOwnedRootDict.get(); 71 m_pRootDict = m_pOwnedRootDict.get();
72 m_PageList.SetSize(7); 72 m_PageList.SetSize(7);
73 } 73 }
74 74
75 private: 75 private:
76 std::unique_ptr<CPDF_Dictionary> m_pOwnedRootDict; 76 std::unique_ptr<CPDF_Dictionary> m_pOwnedRootDict;
77 }; 77 };
78 78
79 class TestLinearized : public CPDF_Linearized { 79 class TestLinearized : public CPDF_LinearizedHeader {
80 public: 80 public:
81 explicit TestLinearized(CPDF_Dictionary* dict) : CPDF_Linearized(dict) {} 81 explicit TestLinearized(CPDF_Dictionary* dict)
82 : CPDF_LinearizedHeader(dict) {}
82 }; 83 };
83 } // namespace 84 } // namespace
84 85
85 class cpdf_document_test : public testing::Test { 86 class cpdf_document_test : public testing::Test {
86 public: 87 public:
87 void SetUp() override { 88 void SetUp() override {
88 CPDF_ModuleMgr* module_mgr = CPDF_ModuleMgr::Get(); 89 CPDF_ModuleMgr* module_mgr = CPDF_ModuleMgr::Get();
89 module_mgr->InitPageModule(); 90 module_mgr->InitPageModule();
90 } 91 }
91 void TearDown() override {} 92 void TearDown() override {}
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 const int test_page_num = 33; 158 const int test_page_num = 33;
158 159
159 EXPECT_FALSE(document.IsPageLoaded(test_page_num)); 160 EXPECT_FALSE(document.IsPageLoaded(test_page_num));
160 EXPECT_EQ(nullptr, document.GetPage(test_page_num)); 161 EXPECT_EQ(nullptr, document.GetPage(test_page_num));
161 162
162 document.SetPageObjNum(test_page_num, obj_num); 163 document.SetPageObjNum(test_page_num, obj_num);
163 164
164 EXPECT_TRUE(document.IsPageLoaded(test_page_num)); 165 EXPECT_TRUE(document.IsPageLoaded(test_page_num));
165 EXPECT_EQ(page_stub, document.GetPage(test_page_num)); 166 EXPECT_EQ(page_stub, document.GetPage(test_page_num));
166 } 167 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698