OLD | NEW |
1 // Copyright 2015 PDFium Authors. All rights reserved. | 1 // Copyright 2015 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/fpdftext/include/cpdf_linkextract.h" | 5 #include "core/fpdftext/cpdf_linkextract.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 // Class to help test functions in CPDF_LinkExtract class. | 9 // Class to help test functions in CPDF_LinkExtract class. |
10 class CPDF_TestLinkExtract : public CPDF_LinkExtract { | 10 class CPDF_TestLinkExtract : public CPDF_LinkExtract { |
11 public: | 11 public: |
12 CPDF_TestLinkExtract() : CPDF_LinkExtract(nullptr) {} | 12 CPDF_TestLinkExtract() : CPDF_LinkExtract(nullptr) {} |
13 | 13 |
14 private: | 14 private: |
15 // Add test cases as friends to access protected member functions. | 15 // Add test cases as friends to access protected member functions. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 {L"CAP.cap@Gmail.Com", L"CAP.cap@Gmail.Com"}, // Keep the original case. | 50 {L"CAP.cap@Gmail.Com", L"CAP.cap@Gmail.Com"}, // Keep the original case. |
51 }; | 51 }; |
52 for (size_t i = 0; i < FX_ArraySize(valid_strs); ++i) { | 52 for (size_t i = 0; i < FX_ArraySize(valid_strs); ++i) { |
53 CFX_WideString text_str(valid_strs[i][0]); | 53 CFX_WideString text_str(valid_strs[i][0]); |
54 CFX_WideString expected_str(L"mailto:"); | 54 CFX_WideString expected_str(L"mailto:"); |
55 expected_str += valid_strs[i][1]; | 55 expected_str += valid_strs[i][1]; |
56 EXPECT_TRUE(extractor.CheckMailLink(text_str)); | 56 EXPECT_TRUE(extractor.CheckMailLink(text_str)); |
57 EXPECT_STREQ(text_str.c_str(), expected_str.c_str()); | 57 EXPECT_STREQ(text_str.c_str(), expected_str.c_str()); |
58 } | 58 } |
59 } | 59 } |
OLD | NEW |