Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(733)

Side by Side Diff: core/fpdfapi/page/cpdf_streamcontentparser_unittest.cpp

Issue 2474303003: Clean up fpdf_page_parsers (Closed)
Patch Set: Fix includes, move method to namespace Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/fpdfapi/page/pageint.h" 5 #include "core/fpdfapi/page/pageint.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 TEST(fpdf_page_parser, PDF_FindKeyAbbreviation) { 8 TEST(cpdf_streamcontentparser, PDF_FindKeyAbbreviation) {
9 EXPECT_EQ(CFX_ByteStringC("BitsPerComponent"), 9 EXPECT_EQ(CFX_ByteStringC("BitsPerComponent"),
10 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC"))); 10 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("BPC")));
11 EXPECT_EQ(CFX_ByteStringC("Width"), 11 EXPECT_EQ(CFX_ByteStringC("Width"),
12 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("W"))); 12 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("W")));
13 EXPECT_EQ(CFX_ByteStringC(""), 13 EXPECT_EQ(CFX_ByteStringC(""),
14 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC(""))); 14 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("")));
15 EXPECT_EQ(CFX_ByteStringC(""), 15 EXPECT_EQ(CFX_ByteStringC(""),
16 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList"))); 16 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("NoInList")));
17 // Prefix should not match. 17 // Prefix should not match.
18 EXPECT_EQ(CFX_ByteStringC(""), 18 EXPECT_EQ(CFX_ByteStringC(""),
19 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("WW"))); 19 PDF_FindKeyAbbreviationForTesting(CFX_ByteStringC("WW")));
20 } 20 }
21 21
22 TEST(fpdf_page_parser, PDF_FindValueAbbreviation) { 22 TEST(cpdf_streamcontentparser, PDF_FindValueAbbreviation) {
23 EXPECT_EQ(CFX_ByteStringC("DeviceGray"), 23 EXPECT_EQ(CFX_ByteStringC("DeviceGray"),
24 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("G"))); 24 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("G")));
25 EXPECT_EQ(CFX_ByteStringC("DCTDecode"), 25 EXPECT_EQ(CFX_ByteStringC("DCTDecode"),
26 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("DCT"))); 26 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("DCT")));
27 EXPECT_EQ(CFX_ByteStringC(""), 27 EXPECT_EQ(CFX_ByteStringC(""),
28 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC(""))); 28 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("")));
29 EXPECT_EQ(CFX_ByteStringC(""), 29 EXPECT_EQ(CFX_ByteStringC(""),
30 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("NoInList"))); 30 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("NoInList")));
31 // Prefix should not match. 31 // Prefix should not match.
32 EXPECT_EQ(CFX_ByteStringC(""), 32 EXPECT_EQ(CFX_ByteStringC(""),
33 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("II"))); 33 PDF_FindValueAbbreviationForTesting(CFX_ByteStringC("II")));
34 } 34 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698