OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium 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 "base/i18n/character_encoding.h" | 5 #include "base/i18n/character_encoding.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace base { | 9 namespace base { |
10 | 10 |
11 TEST(CharacterEncodingTest, GetCanonicalEncodingNameByAliasName) { | 11 TEST(CharacterEncodingTest, GetCanonicalEncodingNameByAliasName) { |
12 EXPECT_STREQ("Big5", GetCanonicalEncodingNameByAliasName("Big5")); | 12 EXPECT_EQ("Big5", GetCanonicalEncodingNameByAliasName("Big5")); |
13 EXPECT_STREQ("windows-874", | 13 EXPECT_EQ("windows-874", GetCanonicalEncodingNameByAliasName("windows-874")); |
14 GetCanonicalEncodingNameByAliasName("windows-874")); | 14 EXPECT_EQ("ISO-8859-8", GetCanonicalEncodingNameByAliasName("ISO-8859-8")); |
15 EXPECT_STREQ("ISO-8859-8", GetCanonicalEncodingNameByAliasName("ISO-8859-8")); | |
16 | 15 |
17 // Non-canonical alias names should be converted to a canonical one. | 16 // Non-canonical alias names should be converted to a canonical one. |
18 EXPECT_STREQ("UTF-8", GetCanonicalEncodingNameByAliasName("utf8")); | 17 EXPECT_EQ("UTF-8", GetCanonicalEncodingNameByAliasName("utf8")); |
19 EXPECT_STREQ("gb18030", GetCanonicalEncodingNameByAliasName("GB18030")); | 18 EXPECT_EQ("gb18030", GetCanonicalEncodingNameByAliasName("GB18030")); |
20 EXPECT_STREQ("windows-874", GetCanonicalEncodingNameByAliasName("tis-620")); | 19 EXPECT_EQ("windows-874", GetCanonicalEncodingNameByAliasName("tis-620")); |
21 EXPECT_STREQ("EUC-KR", GetCanonicalEncodingNameByAliasName("ks_c_5601-1987")); | 20 EXPECT_EQ("EUC-KR", GetCanonicalEncodingNameByAliasName("ks_c_5601-1987")); |
22 } | 21 } |
23 | 22 |
24 } // namespace base | 23 } // namespace base |
OLD | NEW |