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

Side by Side Diff: chrome/browser/chromeos/input_method/input_method_util_unittest.cc

Issue 560623003: Update the input method ID migration map for new VPD design. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/input_method/input_method_util.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/input_method/input_method_util.h" 5 #include "chrome/browser/chromeos/input_method/input_method_util.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 EXPECT_TRUE(l10n_util::IsValidLocaleSyntax(language_code)) 444 EXPECT_TRUE(l10n_util::IsValidLocaleSyntax(language_code))
445 << "Invalid language code " << language_code; 445 << "Invalid language code " << language_code;
446 EXPECT_FALSE(display_name.empty()) 446 EXPECT_FALSE(display_name.empty())
447 << "Invalid language code " << language_code; 447 << "Invalid language code " << language_code;
448 // On error, GetDisplayNameForLocale() returns the |language_code| as-is. 448 // On error, GetDisplayNameForLocale() returns the |language_code| as-is.
449 EXPECT_NE(language_code, base::UTF16ToUTF8(display_name)) 449 EXPECT_NE(language_code, base::UTF16ToUTF8(display_name))
450 << "Invalid language code " << language_code; 450 << "Invalid language code " << language_code;
451 } 451 }
452 } 452 }
453 453
454 // Test the input method ID migration.
455 TEST_F(InputMethodUtilTest, TestInputMethodIDMigration) {
456 const char* const migration_cases[][2] = {
457 {"ime:zh:pinyin", "zh-t-i0-pinyin"},
458 {"ime:zh-t:zhuyin", "zh-hant-t-i0-und"},
459 {"ime:zh-t:quick", "zh-hant-t-i0-cangjie-1987-x-m0-simplified"},
460 {"ime:jp:mozc_us", "nacl_mozc_us"},
461 {"ime:ko:hangul", "hangul_2set"},
462 {"m17n:deva_phone", "vkd_deva_phone"},
463 {"m17n:ar", "vkd_ar"},
464 {"t13n:hi", "hi-t-i0-und"},
465 {"unknown", "unknown"},
466 };
467 std::vector<std::string> input_method_ids;
468 for (size_t i = 0; i < arraysize(migration_cases); ++i)
469 input_method_ids.push_back(migration_cases[i][0]);
470 // Duplicated hangul_2set.
471 input_method_ids.push_back("ime:ko:hangul_2set");
472
473 util_.MigrateInputMethods(&input_method_ids);
474
475 EXPECT_EQ(arraysize(migration_cases), input_method_ids.size());
476 for (size_t i = 0; i < arraysize(migration_cases); ++i)
Seigo Nonaka 2014/09/10 06:17:32 nit: please use braces for multi-line body.
Shu Chen 2014/09/10 06:21:47 Done.
477 EXPECT_EQ(
478 extension_ime_util::GetInputMethodIDByEngineID(migration_cases[i][1]),
479 input_method_ids[i]);
480 }
481
454 } // namespace input_method 482 } // namespace input_method
455 } // namespace chromeos 483 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698