OLD | NEW |
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 }; | 58 }; |
59 | 59 |
60 void SetUp() override { | 60 void SetUp() override { |
61 // We don't need page module or render module, but | 61 // We don't need page module or render module, but |
62 // initialize them to keep the code sane. | 62 // initialize them to keep the code sane. |
63 CPDF_ModuleMgr* module_mgr = CPDF_ModuleMgr::Get(); | 63 CPDF_ModuleMgr* module_mgr = CPDF_ModuleMgr::Get(); |
64 module_mgr->InitPageModule(); | 64 module_mgr->InitPageModule(); |
65 | 65 |
66 m_pDoc = pdfium::MakeUnique<CPDF_TestPdfDocument>(); | 66 m_pDoc = pdfium::MakeUnique<CPDF_TestPdfDocument>(); |
67 m_pIndirectObjs = m_pDoc->GetHolder(); | 67 m_pIndirectObjs = m_pDoc->GetHolder(); |
| 68 |
68 // Setup the root directory. | 69 // Setup the root directory. |
69 m_pRootObj.reset(new CPDF_Dictionary()); | 70 m_pRootObj = pdfium::MakeUnique<CPDF_Dictionary>(); |
70 m_pDoc->SetRoot(m_pRootObj.get()); | 71 m_pDoc->SetRoot(m_pRootObj.get()); |
71 } | 72 } |
72 | 73 |
73 void TearDown() override { | 74 void TearDown() override { |
74 m_pRootObj.reset(); | 75 m_pRootObj.reset(); |
75 m_pIndirectObjs = nullptr; | 76 m_pIndirectObjs = nullptr; |
76 m_pDoc.reset(); | 77 m_pDoc.reset(); |
77 CPDF_ModuleMgr::Destroy(); | 78 CPDF_ModuleMgr::Destroy(); |
78 } | 79 } |
79 | 80 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 EXPECT_TRUE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, | 265 EXPECT_TRUE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, |
265 &x, &y, &zoom)); | 266 &x, &y, &zoom)); |
266 EXPECT_FALSE(hasX); | 267 EXPECT_FALSE(hasX); |
267 EXPECT_FALSE(hasY); | 268 EXPECT_FALSE(hasY); |
268 EXPECT_FALSE(hasZoom); | 269 EXPECT_FALSE(hasZoom); |
269 | 270 |
270 array = pdfium::MakeUnique<CPDF_Array>(); | 271 array = pdfium::MakeUnique<CPDF_Array>(); |
271 EXPECT_FALSE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, | 272 EXPECT_FALSE(FPDFDest_GetLocationInPage(array.get(), &hasX, &hasY, &hasZoom, |
272 &x, &y, &zoom)); | 273 &x, &y, &zoom)); |
273 } | 274 } |
OLD | NEW |