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

Side by Side Diff: base/i18n/character_encoding_unittest.cc

Issue 2578003002: Move |GetCanonicalEncodingNameByAliasName| to base/i18n (Closed)
Patch Set: return const char* Created 4 years 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "base/i18n/character_encoding.h"
6
7 #include "testing/gtest/include/gtest/gtest.h"
8
9 namespace base {
10
11 TEST(CharacterEncodingTest, GetCanonicalEncodingNameByAliasName) {
12 EXPECT_STREQ("Big5", GetCanonicalEncodingNameByAliasName("Big5"));
13 EXPECT_STREQ("windows-874",
14 GetCanonicalEncodingNameByAliasName("windows-874"));
15 EXPECT_STREQ("ISO-8859-8", GetCanonicalEncodingNameByAliasName("ISO-8859-8"));
16
17 // Non-canonical alias names should be converted to a canonical one.
18 EXPECT_STREQ("UTF-8", GetCanonicalEncodingNameByAliasName("utf8"));
19 EXPECT_STREQ("gb18030", GetCanonicalEncodingNameByAliasName("GB18030"));
20 EXPECT_STREQ("windows-874", GetCanonicalEncodingNameByAliasName("tis-620"));
21 EXPECT_STREQ("EUC-KR", GetCanonicalEncodingNameByAliasName("ks_c_5601-1987"));
22 }
23
24 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698