diff options
author | Henrique Nakashima <hnakashima@chromium.org> | 2018-07-05 18:04:19 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-07-05 18:04:19 +0000 |
commit | 7007fd56221cb2c19444051ad34afb758c89706b (patch) | |
tree | 1fab21c7a5df5e78a55598245a94bde9913fdedd /fpdfsdk/fpdf_edit_embeddertest.cpp | |
parent | 6f0d8ea78adbb7f5d93e2470a6888b5417a01bca (diff) | |
download | pdfium-7007fd56221cb2c19444051ad34afb758c89706b.tar.xz |
Create content mark APIs to get values by key.
Bug: pdfium:1037
Change-Id: Ie887c0bbf3e543676adec6d8411b0b3254677d3c
Reviewed-on: https://pdfium-review.googlesource.com/37170
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_edit_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/fpdf_edit_embeddertest.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp index 445b0cc6b9..a490162e15 100644 --- a/fpdfsdk/fpdf_edit_embeddertest.cpp +++ b/fpdfsdk/fpdf_edit_embeddertest.cpp @@ -573,6 +573,12 @@ TEST_F(FPDFEditEmbeddertest, RemoveMarkedObjectsPrime) { FPDFPageObjMark_GetParamValueType(mark, 0)); int square_root = FPDFPageObjMark_GetParamIntValue(mark, 0); EXPECT_EQ(i + 1, square_root * square_root); + + EXPECT_EQ(FPDF_OBJECT_NUMBER, + FPDFPageObjMark_GetParamValueTypeByKey(mark, "Factor")); + EXPECT_TRUE(FPDFPageObjMark_GetParamIntValueByKey(mark, "Factor", + &square_root)); + EXPECT_EQ(i + 1, square_root * square_root); } else if (name == L"GreaterThanTen") { greater_than_ten_count++; EXPECT_EQ(0, FPDFPageObjMark_CountParams(mark)); @@ -590,6 +596,15 @@ TEST_F(FPDFEditEmbeddertest, RemoveMarkedObjectsPrime) { GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); EXPECT_EQ(L"Last", value); EXPECT_EQ(18, i); + + EXPECT_EQ(FPDF_OBJECT_STRING, + FPDFPageObjMark_GetParamValueTypeByKey(mark, "Position")); + unsigned long length; + EXPECT_TRUE(FPDFPageObjMark_GetParamStringValueByKey( + mark, "Position", buffer, 256, &length)); + ASSERT_GT(length, 0u); + value = GetPlatformWString(reinterpret_cast<unsigned short*>(buffer)); + EXPECT_EQ(L"Last", value); } else { FAIL(); } |