| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "app/app_paths.h" | 7 #include "app/app_paths.h" |
| 8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
| 9 #if !defined(OS_MACOSX) | 9 #if !defined(OS_MACOSX) |
| 10 #include "app/test/data/resource.h" | 10 #include "app/test/data/resource.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 l10n_util::TextDirection GetTextDirection(const char* locale_name) { | 37 l10n_util::TextDirection GetTextDirection(const char* locale_name) { |
| 38 return l10n_util::GetTextDirectionForLocale(locale_name); | 38 return l10n_util::GetTextDirectionForLocale(locale_name); |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace | 41 } // namespace |
| 42 | 42 |
| 43 class L10nUtilTest : public PlatformTest { | 43 class L10nUtilTest : public PlatformTest { |
| 44 }; | 44 }; |
| 45 | 45 |
| 46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 47 TEST_F(L10nUtilTest, GetString) { | 47 // TODO(beng): disabled until app strings move to app. |
| 48 TEST_F(L10nUtilTest, DISABLED_GetString) { |
| 48 std::wstring s = l10n_util::GetString(IDS_SIMPLE); | 49 std::wstring s = l10n_util::GetString(IDS_SIMPLE); |
| 49 EXPECT_EQ(std::wstring(L"Hello World!"), s); | 50 EXPECT_EQ(std::wstring(L"Hello World!"), s); |
| 50 | 51 |
| 51 s = l10n_util::GetStringF(IDS_PLACEHOLDERS, L"chrome", L"10"); | 52 s = l10n_util::GetStringF(IDS_PLACEHOLDERS, L"chrome", L"10"); |
| 52 EXPECT_EQ(std::wstring(L"Hello, chrome. Your number is 10."), s); | 53 EXPECT_EQ(std::wstring(L"Hello, chrome. Your number is 10."), s); |
| 53 | 54 |
| 54 s = l10n_util::GetStringF(IDS_PLACEHOLDERS_2, 20); | 55 s = l10n_util::GetStringF(IDS_PLACEHOLDERS_2, 20); |
| 55 EXPECT_EQ(std::wstring(L"You owe me $20."), s); | 56 EXPECT_EQ(std::wstring(L"You owe me $20."), s); |
| 56 } | 57 } |
| 57 #endif // defined(OS_WIN) | 58 #endif // defined(OS_WIN) |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("en")); | 427 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("en")); |
| 427 // Chinese in China with '-'. | 428 // Chinese in China with '-'. |
| 428 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("zh-CN")); | 429 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("zh-CN")); |
| 429 // Filipino : 3-letter code | 430 // Filipino : 3-letter code |
| 430 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("fil")); | 431 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("fil")); |
| 431 // Russian | 432 // Russian |
| 432 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ru")); | 433 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ru")); |
| 433 // Japanese that uses multiple scripts | 434 // Japanese that uses multiple scripts |
| 434 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ja")); | 435 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ja")); |
| 435 } | 436 } |
| OLD | NEW |