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

Side by Side Diff: chrome/browser/chromeos/options/language_config_view_test.cc

Issue 1512022: Add NormalizeLanguageCode() to normalize language codes. (Closed)
Patch Set: add a comment Created 10 years, 8 months 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
« no previous file with comments | « chrome/browser/chromeos/options/language_config_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/chromeos/options/language_config_view.h" 5 #include "chrome/browser/chromeos/options/language_config_view.h"
6 #include <string> 6 #include <string>
7 #include "testing/gtest/include/gtest/gtest.h" 7 #include "testing/gtest/include/gtest/gtest.h"
8 8
9 namespace chromeos { 9 namespace chromeos {
10 10
11 TEST(LanguageConfigViewTest, MaybeRewriteLanguageName) { 11 TEST(LanguageConfigViewTest, MaybeRewriteLanguageName) {
12 EXPECT_EQ(L"English", 12 EXPECT_EQ(L"English",
13 LanguageConfigView::MaybeRewriteLanguageName(L"English")); 13 LanguageConfigView::MaybeRewriteLanguageName(L"English"));
14 EXPECT_EQ(L"Others", 14 EXPECT_EQ(L"Others",
15 LanguageConfigView::MaybeRewriteLanguageName(L"t")); 15 LanguageConfigView::MaybeRewriteLanguageName(L"t"));
16 } 16 }
17 17
18 TEST(LanguageConfigViewTest, NormalizeLanguageCode) {
19 // TODO(yusukes): test all language codes that IBus provides.
20 EXPECT_EQ("jpn",
21 LanguageConfigView::NormalizeLanguageCode("ja"));
22 EXPECT_EQ("jpn",
23 LanguageConfigView::NormalizeLanguageCode("jpn"));
24 EXPECT_EQ("t",
25 LanguageConfigView::NormalizeLanguageCode("t"));
26 EXPECT_EQ("zh_CN",
27 LanguageConfigView::NormalizeLanguageCode("zh_CN"));
28 }
29
18 } // namespace chromeos 30 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/language_config_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698