diff options
author | Artem Strygin <art-snake@yandex-team.ru> | 2018-07-12 09:50:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-12 09:50:19 +0000 |
commit | 859d06f4ab89f4b6bcf4428585271c8c1d18907c (patch) | |
tree | d0d511c25199dbedfbba65c3dfecd954392b90f0 /core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp | |
parent | 68d04f284423414392b7176cbd74671f50bae196 (diff) | |
download | pdfium-859d06f4ab89f4b6bcf4428585271c8c1d18907c.tar.xz |
Implement CPDF_HintsTable::SharedObjGroupInfo.
Merge shared objects related data into CPDF_HintsTable::SharedObjGroupInfo.
Change-Id: I53bb7fc42ea6bcd26b3ebf91b8c6aa402108d086
Reviewed-on: https://pdfium-review.googlesource.com/15830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Art Snake <art-snake@yandex-team.ru>
Diffstat (limited to 'core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp b/core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp index 3d98196093..af0e9ff745 100644 --- a/core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp +++ b/core/fpdfapi/parser/cpdf_hint_tables_unittest.cpp @@ -10,6 +10,8 @@ #include "core/fpdfapi/cpdf_modulemgr.h" #include "core/fpdfapi/parser/cpdf_data_avail.h" +#include "core/fpdfapi/parser/cpdf_object.h" +#include "core/fpdfapi/parser/cpdf_syntax_parser.h" #include "core/fxcrt/fx_stream.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" @@ -68,7 +70,7 @@ TEST_F(CPDF_HintTablesTest, Load) { hint_tables->GetPagePos(2, &page_start, &page_length, &page_obj_num)); } -TEST_F(CPDF_HintTablesTest, PageInfos) { +TEST_F(CPDF_HintTablesTest, PageAndGroupInfos) { auto data_avail = MakeDataAvailFromFile("feature_linearized_loading.pdf"); ASSERT_EQ(CPDF_DataAvail::DocAvailStatus::DataAvailable, data_avail->IsDocAvail(nullptr)); @@ -95,4 +97,25 @@ TEST_F(CPDF_HintTablesTest, PageInfos) { EXPECT_EQ(2u, hint_tables->PageInfos()[1].Identifiers()[0]); EXPECT_EQ(5u, hint_tables->PageInfos()[1].Identifiers()[1]); EXPECT_EQ(3u, hint_tables->PageInfos()[1].Identifiers()[2]); + + // SharedGroupInfo + ASSERT_EQ(6u, hint_tables->SharedGroupInfos().size()); + + EXPECT_EQ(777, hint_tables->SharedGroupInfos()[0].m_szOffset); + EXPECT_EQ(254u, hint_tables->SharedGroupInfos()[0].m_dwLength); + + EXPECT_EQ(1031, hint_tables->SharedGroupInfos()[1].m_szOffset); + EXPECT_EQ(389u, hint_tables->SharedGroupInfos()[1].m_dwLength); + + EXPECT_EQ(1420, hint_tables->SharedGroupInfos()[2].m_szOffset); + EXPECT_EQ(726u, hint_tables->SharedGroupInfos()[2].m_dwLength); + + EXPECT_EQ(2146, hint_tables->SharedGroupInfos()[3].m_szOffset); + EXPECT_EQ(290u, hint_tables->SharedGroupInfos()[3].m_dwLength); + + EXPECT_EQ(2436, hint_tables->SharedGroupInfos()[4].m_szOffset); + EXPECT_EQ(2669u, hint_tables->SharedGroupInfos()[4].m_dwLength); + + EXPECT_EQ(10939, hint_tables->SharedGroupInfos()[5].m_szOffset); + EXPECT_EQ(544u, hint_tables->SharedGroupInfos()[5].m_dwLength); } |