summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document_unittest.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-11-04 21:06:05 -0700
committerCommit bot <commit-bot@chromium.org>2016-11-04 21:06:05 -0700
commit19cd7cc42700b844e6d9fc170a65bf7122d468b8 (patch)
tree127477b084005457579c599b2ec9eef0668a1479 /core/fpdfapi/parser/cpdf_document_unittest.cpp
parent71333dc57ac7e4cf7963c83333730b3882ab371f (diff)
downloadpdfium-chromium/2912.tar.xz
Revert of Unify some code (patchset #14 id:260001 of https://codereview.chromium.org/2466023002/ )chromium/2912chromium/2911
Reason for revert: Breaking the chrome roll. See https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/331856 Original issue's description: > Unify some code > > Move parsing of linearized header into separate CPDF_Linearized class. > > Committed: https://pdfium.googlesource.com/pdfium/+/71333dc57ac7e4cf7963c83333730b3882ab371f TBR=thestig@chromium.org,brucedawson@chromium.org,art-snake@yandex-team.ru # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Review-Url: https://codereview.chromium.org/2474283005
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document_unittest.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_document_unittest.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/cpdf_document_unittest.cpp b/core/fpdfapi/parser/cpdf_document_unittest.cpp
index e20a5a1d1d..16d0ade069 100644
--- a/core/fpdfapi/parser/cpdf_document_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_document_unittest.cpp
@@ -9,13 +9,15 @@
#include "core/fpdfapi/cpdf_modulemgr.h"
#include "core/fpdfapi/parser/cpdf_array.h"
#include "core/fpdfapi/parser/cpdf_dictionary.h"
-#include "core/fpdfapi/parser/cpdf_linearized.h"
#include "core/fpdfapi/parser/cpdf_parser.h"
#include "core/fxcrt/fx_memory.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
+using ScopedDictionary =
+ std::unique_ptr<CPDF_Dictionary, ReleaseDeleter<CPDF_Dictionary>>;
+
CPDF_Dictionary* CreatePageTreeNode(CPDF_Array* kids,
CPDF_Document* pDoc,
int count) {
@@ -75,11 +77,6 @@ class CPDF_TestDocumentForPages : public CPDF_Document {
private:
std::unique_ptr<CPDF_Dictionary> m_pOwnedRootDict;
};
-
-class TestLinearized : public CPDF_Linearized {
- public:
- explicit TestLinearized(CPDF_Dictionary* dict) : CPDF_Linearized(dict) {}
-};
} // namespace
class cpdf_document_test : public testing::Test {
@@ -145,12 +142,10 @@ TEST_F(cpdf_document_test, UseCachedPageObjNumIfHaveNotPagesDict) {
// 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->SetBooleanFor("Linearized", true);
+ std::unique_ptr<CPDF_Dictionary> dict(new CPDF_Dictionary());
const int page_count = 100;
dict->SetIntegerFor("N", page_count);
- TestLinearized linearized(dict.get());
- document.LoadLinearizedDoc(&linearized);
+ document.LoadLinearizedDoc(dict.get());
ASSERT_EQ(page_count, document.GetPageCount());
CPDF_Object* page_stub = new CPDF_Dictionary();
const uint32_t obj_num = document.AddIndirectObject(page_stub);