| OLD | NEW |
| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 580 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); | 580 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); |
| 581 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); | 581 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); |
| 582 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); | 582 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); |
| 583 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); | 583 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); |
| 584 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); | 584 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); |
| 585 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); | 585 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); |
| 586 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); | 586 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); |
| 587 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); | 587 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); |
| 588 } | 588 } |
| 589 | 589 |
| 590 // TODO(jungshik): Enable after http://crbug.com/707515 is fixed. | 590 TEST_F(L10nUtilTest, TimeDurationFormatAllLocales) { |
| 591 TEST_F(L10nUtilTest, DISABLED_TimeDurationFormatAllLocales) { | |
| 592 base::test::ScopedRestoreICUDefaultLocale restore_locale; | 591 base::test::ScopedRestoreICUDefaultLocale restore_locale; |
| 593 | 592 |
| 594 // Verify that base::TimeDurationFormat() works for all available locales: | 593 // Verify that base::TimeDurationFormat() works for all available locales: |
| 595 // http://crbug.com/707515 | 594 // http://crbug.com/707515 |
| 596 base::TimeDelta kDelta = base::TimeDelta::FromMinutes(15 * 60 + 42); | 595 base::TimeDelta kDelta = base::TimeDelta::FromMinutes(15 * 60 + 42); |
| 597 for (const std::string& locale : l10n_util::GetAvailableLocales()) { | 596 for (const std::string& locale : l10n_util::GetAvailableLocales()) { |
| 598 base::i18n::SetICUDefaultLocale(locale); | 597 base::i18n::SetICUDefaultLocale(locale); |
| 599 base::string16 str; | 598 base::string16 str; |
| 600 const bool result = | 599 const bool result = |
| 601 base::TimeDurationFormat(kDelta, base::DURATION_WIDTH_NUMERIC, &str); | 600 base::TimeDurationFormat(kDelta, base::DURATION_WIDTH_NUMERIC, &str); |
| 602 EXPECT_TRUE(result) << "Failed to format duration for " << locale; | 601 EXPECT_TRUE(result) << "Failed to format duration for " << locale; |
| 603 if (result) | 602 if (result) |
| 604 EXPECT_FALSE(str.empty()) << "Got empty string for " << locale; | 603 EXPECT_FALSE(str.empty()) << "Got empty string for " << locale; |
| 605 } | 604 } |
| 606 } | 605 } |
| OLD | NEW |