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

Side by Side Diff: ui/base/l10n/l10n_util_unittest.cc

Issue 2755963002: Roll third_party/icu from 450be73 to b34251f (Closed)
Patch Set: enable TimeDurationFormatAllLocales and roll ICU to b34251f Created 3 years, 8 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 | « DEPS ('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 <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
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 }
OLDNEW
« no previous file with comments | « DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698