diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-06-26 16:38:49 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-06-26 16:38:49 +0000 |
commit | 2d868435f4c0d47ded1ea405ad2af6b9d83b6651 (patch) | |
tree | 7e2e931e05b962b049879def3e6793a7c43ee95a /core/fpdfapi/parser/cpdf_document_unittest.cpp | |
parent | 20582f797f3fdc6308141dbed5eed7d3f84619c9 (diff) | |
download | pdfium-2d868435f4c0d47ded1ea405ad2af6b9d83b6651.tar.xz |
Unify CPDF_Document loading methods.
Change-Id: Ibf7aee942027adace7ec0831aefe0fe8c28e41cc
Reviewed-on: https://pdfium-review.googlesource.com/35610
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document_unittest.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_document_unittest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp index fa52d3bc7f..522aa65fc9 100644 --- a/core/fpdfapi/parser/cpdf_document_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp @@ -215,13 +215,15 @@ TEST_F(cpdf_document_test, UseCachedPageObjNumIfHaveNotPagesDict) { // ObjNum can be added in CPDF_DataAvail::IsPageAvail, and PagesDict // can be not exists in this case. // (case, when hint table is used to page check in CPDF_DataAvail). - CPDF_Document document(pdfium::MakeUnique<CPDF_Parser>()); auto dict = pdfium::MakeUnique<CPDF_Dictionary>(); dict->SetNewFor<CPDF_Boolean>("Linearized", true); const int page_count = 100; dict->SetNewFor<CPDF_Number>("N", page_count); - TestLinearized linearized(dict.get()); - document.LoadLinearizedDoc(&linearized); + auto linearized = pdfium::MakeUnique<TestLinearized>(dict.get()); + auto parser = pdfium::MakeUnique<CPDF_Parser>(); + parser->SetLinearizedHeader(std::move(linearized)); + CPDF_Document document(std::move(parser)); + document.LoadDoc(); ASSERT_EQ(page_count, document.GetPageCount()); CPDF_Object* page_stub = document.NewIndirect<CPDF_Dictionary>(); const uint32_t obj_num = page_stub->GetObjNum(); |