diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-28 18:00:37 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-29 13:37:46 +0000 |
commit | 081d41208489a318163a306789de4139b2dddfc7 (patch) | |
tree | e0bc3c7e2ad095013cd5398e65a7a0d067e62284 /core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp | |
parent | 7bec2ff744a71a0a7e0fec86be13095a323375ab (diff) | |
download | pdfium-081d41208489a318163a306789de4139b2dddfc7.tar.xz |
Make some CPDF_StreamContentParser methods static.
For methods that are only exposed for testing. Once they are static,
there is no need for dummy CPDF_StreamContentParser constructor calls in
the unit tests. Adjust the CPDF_StreamContentParser constructor now that
one of the parameters can no longer be a nullptr.
Change-Id: If29b02ea216002a7bb325b1913281f58b70382aa
Reviewed-on: https://pdfium-review.googlesource.com/12230
Commit-Queue: dsinclair <dsinclair@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp')
-rw-r--r-- | core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp | 38 |
1 files changed, 21 insertions, 17 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp index ffc0d95107..6b43935a1d 100644 --- a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp +++ b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp @@ -6,35 +6,39 @@ #include "testing/gtest/include/gtest/gtest.h" TEST(cpdf_streamcontentparser, PDF_FindKeyAbbreviation) { - CPDF_StreamContentParser parser(nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, 0); - EXPECT_EQ(CFX_ByteStringC("BitsPerComponent"), - parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC"))); + CPDF_StreamContentParser::FindKeyAbbreviationForTesting( + CFX_ByteStringC("BPC"))); EXPECT_EQ(CFX_ByteStringC("Width"), - parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("W"))); + CPDF_StreamContentParser::FindKeyAbbreviationForTesting( + CFX_ByteStringC("W"))); EXPECT_EQ(CFX_ByteStringC(""), - parser.FindKeyAbbreviationForTesting(CFX_ByteStringC(""))); + CPDF_StreamContentParser::FindKeyAbbreviationForTesting( + CFX_ByteStringC(""))); EXPECT_EQ(CFX_ByteStringC(""), - parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList"))); + CPDF_StreamContentParser::FindKeyAbbreviationForTesting( + CFX_ByteStringC("NoInList"))); // Prefix should not match. EXPECT_EQ(CFX_ByteStringC(""), - parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("WW"))); + CPDF_StreamContentParser::FindKeyAbbreviationForTesting( + CFX_ByteStringC("WW"))); } TEST(cpdf_streamcontentparser, PDF_FindValueAbbreviation) { - CPDF_StreamContentParser parser(nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, 0); - EXPECT_EQ(CFX_ByteStringC("DeviceGray"), - parser.FindValueAbbreviationForTesting(CFX_ByteStringC("G"))); + CPDF_StreamContentParser::FindValueAbbreviationForTesting( + CFX_ByteStringC("G"))); EXPECT_EQ(CFX_ByteStringC("DCTDecode"), - parser.FindValueAbbreviationForTesting(CFX_ByteStringC("DCT"))); + CPDF_StreamContentParser::FindValueAbbreviationForTesting( + CFX_ByteStringC("DCT"))); + EXPECT_EQ(CFX_ByteStringC(""), + CPDF_StreamContentParser::FindValueAbbreviationForTesting( + CFX_ByteStringC(""))); EXPECT_EQ(CFX_ByteStringC(""), - parser.FindValueAbbreviationForTesting(CFX_ByteStringC(""))); - EXPECT_EQ(CFX_ByteStringC(""), parser.FindValueAbbreviationForTesting( - CFX_ByteStringC("NoInList"))); + CPDF_StreamContentParser::FindValueAbbreviationForTesting( + CFX_ByteStringC("NoInList"))); // Prefix should not match. EXPECT_EQ(CFX_ByteStringC(""), - parser.FindValueAbbreviationForTesting(CFX_ByteStringC("II"))); + CPDF_StreamContentParser::FindValueAbbreviationForTesting( + CFX_ByteStringC("II"))); } |