summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_doc_unittest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-06-26 15:19:38 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-26 15:19:38 +0000
commitb86544285e263310c1017a3aa056d71e68c5d5a1 (patch)
treef35299979dadda2c22f580606e8164cdc84e0d36 /fpdfsdk/fpdf_doc_unittest.cpp
parent8625d3b73eb51d2100cdf15e7a43b998b8251dc9 (diff)
downloadpdfium-b86544285e263310c1017a3aa056d71e68c5d5a1.tar.xz
Make CPDF_Document::m_pRootDict an UnownedPtr<>.
In turn, this requires making some of the tests use an indirect root dictionary so as to satisfy the lifetime requirements. Change-Id: Ibdbe294a76200d4486134e5848c169a6c2d802bf Reviewed-on: https://pdfium-review.googlesource.com/36110 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_doc_unittest.cpp')
-rw-r--r--fpdfsdk/fpdf_doc_unittest.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/fpdfsdk/fpdf_doc_unittest.cpp b/fpdfsdk/fpdf_doc_unittest.cpp
index 0234d47833..58b8ffd42d 100644
--- a/fpdfsdk/fpdf_doc_unittest.cpp
+++ b/fpdfsdk/fpdf_doc_unittest.cpp
@@ -42,13 +42,13 @@ class PDFDocTest : public testing::Test {
CPDF_ModuleMgr::Get()->Init();
auto pTestDoc = pdfium::MakeUnique<CPDF_TestDocument>();
m_pIndirectObjs = pTestDoc->GetHolder();
- m_pRootObj = pdfium::MakeUnique<CPDF_Dictionary>();
- pTestDoc->SetRoot(m_pRootObj.get());
+ m_pRootObj = m_pIndirectObjs->NewIndirect<CPDF_Dictionary>();
+ pTestDoc->SetRoot(m_pRootObj.Get());
m_pDoc.reset(FPDFDocumentFromCPDFDocument(pTestDoc.release()));
}
void TearDown() override {
- m_pRootObj.reset();
+ m_pRootObj = nullptr;
m_pIndirectObjs = nullptr;
m_pDoc.reset();
CPDF_ModuleMgr::Destroy();
@@ -67,7 +67,7 @@ class PDFDocTest : public testing::Test {
protected:
ScopedFPDFDocument m_pDoc;
UnownedPtr<CPDF_IndirectObjectHolder> m_pIndirectObjs;
- std::unique_ptr<CPDF_Dictionary> m_pRootObj;
+ UnownedPtr<CPDF_Dictionary> m_pRootObj;
};
TEST_F(PDFDocTest, FindBookmark) {