summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-05-25 14:04:59 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-05-25 18:17:31 +0000
commit5acacd361b15b82a8b30cdd5cb92abb8a2104ecf (patch)
treef602c78b802f67f41ea2099f8c7051a324060162 /core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp
parente0e2cd4f8a5634f2878f9b3bf3ce321ffd53a980 (diff)
downloadpdfium-5acacd361b15b82a8b30cdd5cb92abb8a2104ecf.tar.xz
Break apart the pageint.h file.
This CL separates pageint.h and the supporting cpp files into indivudal class files. Change-Id: Idcadce41976a8cd5f0d916e6a5ebbc283fd36527 Reviewed-on: https://pdfium-review.googlesource.com/5930 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp30
1 files changed, 18 insertions, 12 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp
index be2fcb09e4..ffc0d95107 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp
+++ b/core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp
@@ -2,33 +2,39 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "core/fpdfapi/page/pageint.h"
+#include "core/fpdfapi/page/cpdf_streamcontentparser.h"
#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"),
- PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC")));
+ parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC")));
EXPECT_EQ(CFX_ByteStringC("Width"),
- PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("W")));
+ parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("W")));
EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("")));
+ parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("")));
EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList")));
+ parser.FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList")));
// Prefix should not match.
EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("WW")));
+ parser.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"),
- PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("G")));
+ parser.FindValueAbbreviationForTesting(CFX_ByteStringC("G")));
EXPECT_EQ(CFX_ByteStringC("DCTDecode"),
- PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("DCT")));
- EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("")));
+ parser.FindValueAbbreviationForTesting(CFX_ByteStringC("DCT")));
EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("NoInList")));
+ parser.FindValueAbbreviationForTesting(CFX_ByteStringC("")));
+ EXPECT_EQ(CFX_ByteStringC(""), parser.FindValueAbbreviationForTesting(
+ CFX_ByteStringC("NoInList")));
// Prefix should not match.
EXPECT_EQ(CFX_ByteStringC(""),
- PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("II")));
+ parser.FindValueAbbreviationForTesting(CFX_ByteStringC("II")));
}