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 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("en")); | 432 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("en")); |
433 // Chinese in China with '-'. | 433 // Chinese in China with '-'. |
434 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("zh-CN")); | 434 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("zh-CN")); |
435 // Filipino : 3-letter code | 435 // Filipino : 3-letter code |
436 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("fil")); | 436 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("fil")); |
437 // Russian | 437 // Russian |
438 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ru")); | 438 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ru")); |
439 // Japanese that uses multiple scripts | 439 // Japanese that uses multiple scripts |
440 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ja")); | 440 EXPECT_EQ(l10n_util::LEFT_TO_RIGHT, GetTextDirection("ja")); |
441 } | 441 } |
| 442 |
| 443 // Test upper and lower case string conversion. |
| 444 TEST_F(L10nUtilTest, UpperLower) { |
| 445 string16 mixed(ASCIIToUTF16("Text with UPPer & lowER casE.")); |
| 446 const string16 expected_lower(ASCIIToUTF16("text with upper & lower case.")); |
| 447 const string16 expected_upper(ASCIIToUTF16("TEXT WITH UPPER & LOWER CASE.")); |
| 448 |
| 449 string16 result = l10n_util::ToLower(mixed); |
| 450 EXPECT_EQ(result, expected_lower); |
| 451 |
| 452 result = l10n_util::ToUpper(mixed); |
| 453 EXPECT_EQ(result, expected_upper); |
| 454 } |
| 455 |
OLD | NEW |