Chromium Code Reviews| Index: chrome/installer/util/language_selector_unittest.cc |
| diff --git a/chrome/installer/util/language_selector_unittest.cc b/chrome/installer/util/language_selector_unittest.cc |
| index 1e5bc00b0fb36d3df91627eeea2dd953c97c9e73..9ba86cc21cb046477a1bec3ad5dafa665b73b960 100644 |
| --- a/chrome/installer/util/language_selector_unittest.cc |
| +++ b/chrome/installer/util/language_selector_unittest.cc |
| @@ -126,3 +126,61 @@ INSTANTIATE_TEST_CASE_P( |
| ::testing::ValuesIn( |
| &kWildcardMatchCandidates[0], |
| &kWildcardMatchCandidates[arraysize(kWildcardMatchCandidates)])); |
| + |
| +// A fixture for testing aliases that match to an expected translation. The |
| +// first member of the tuple is the expected translation, the second is a |
| +// candidate that should be aliased to the expectation. |
| +class LanguageSelectorAliasTest |
| + : public ::testing::TestWithParam< std::tr1::tuple<const wchar_t*, |
| + const wchar_t*> > { |
| +}; |
| + |
| +// Test that the candidate language maps to the aliased translation. |
| +TEST_P(LanguageSelectorAliasTest, AliasesMatch) { |
| + installer::LanguageSelector instance( |
| + std::vector<std::wstring>(1, std::tr1::get<1>(GetParam()))); |
| + EXPECT_EQ(std::tr1::get<0>(GetParam()), instance.selected_translation()); |
| +} |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + EnGbAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"en-gb"), |
| + ::testing::Values(L"en-au", L"en-ca", L"en-nz", L"en-za"))); |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + IwAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"iw"), |
| + ::testing::Values(L"he"))); |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + NoAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"no"), |
| + ::testing::Values(L"nb"))); |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + FilAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"fil"), |
| + ::testing::Values(L"tl"))); |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + ZhCnAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"zh-cn"), |
| + ::testing::Values(L"zh-chs", L"zh-hans", L"zh-sg"))); |
| + |
| +INSTANTIATE_TEST_CASE_P( |
| + ZhTwAliases, |
| + LanguageSelectorAliasTest, |
| + ::testing::Combine( |
| + ::testing::Values(L"zh-tw"), |
| + ::testing::Values(L"zh-cht", L"zh-hant", L"zh-hk", L"zh-mk", |
|
jungshik at Google
2011/11/29 23:30:37
MK is for Macedonia. So, it should be dropped.
grt (UTC plus 2)
2011/12/01 14:31:11
Done.
|
| + L"zh-mo"))); |