Chromium Code Reviews| Index: base/i18n/character_encoding_unittest.cc |
| diff --git a/base/i18n/character_encoding_unittest.cc b/base/i18n/character_encoding_unittest.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..00d58a4a29649c36a14747456cf59224554d0933 |
| --- /dev/null |
| +++ b/base/i18n/character_encoding_unittest.cc |
| @@ -0,0 +1,21 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "base/i18n/character_encoding.h" |
| + |
| +#include "testing/gtest/include/gtest/gtest.h" |
| + |
| +namespace base { |
| + |
| +TEST(CharacterEncodingTest, GetCanonicalEncodingNameByAliasName) { |
| + EXPECT_EQ("Big5", GetCanonicalEncodingNameByAliasName("Big5")); |
| + EXPECT_EQ("windows-874", GetCanonicalEncodingNameByAliasName("windows-874")); |
| + EXPECT_EQ("ISO-8859-8", GetCanonicalEncodingNameByAliasName("ISO-8859-8")); |
| + |
| + // Non-canonical alias names should be converted to a canonical one. |
| + EXPECT_EQ("UTF-8", GetCanonicalEncodingNameByAliasName("utf8")); |
| + EXPECT_EQ("gb18030", GetCanonicalEncodingNameByAliasName("GB18030")); |
|
jungshik at Google
2016/12/15 18:35:01
While you're at it, you'd better add a couple of m
Jinsuk Kim
2016/12/16 00:03:10
I don't know all the history, but it means this bu
|
| +} |
| + |
| +} // namespace base |