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

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

Issue 2230183002: ui: Use stl utilities from the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 4 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 | « ui/base/ime/win/tsf_input_scope.cc ('k') | ui/base/models/tree_node_model.h » ('j') | 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 "base/environment.h" 7 #include "base/environment.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 strings.push_back(new StringWrapper(UTF8ToUTF16("d"))); 392 strings.push_back(new StringWrapper(UTF8ToUTF16("d")));
393 strings.push_back(new StringWrapper(UTF8ToUTF16("b"))); 393 strings.push_back(new StringWrapper(UTF8ToUTF16("b")));
394 strings.push_back(new StringWrapper(UTF8ToUTF16("a"))); 394 strings.push_back(new StringWrapper(UTF8ToUTF16("a")));
395 l10n_util::SortStringsUsingMethod("en-US", 395 l10n_util::SortStringsUsingMethod("en-US",
396 &strings, 396 &strings,
397 &StringWrapper::string); 397 &StringWrapper::string);
398 ASSERT_TRUE(UTF8ToUTF16("a") == strings[0]->string()); 398 ASSERT_TRUE(UTF8ToUTF16("a") == strings[0]->string());
399 ASSERT_TRUE(UTF8ToUTF16("b") == strings[1]->string()); 399 ASSERT_TRUE(UTF8ToUTF16("b") == strings[1]->string());
400 ASSERT_TRUE(UTF8ToUTF16("C") == strings[2]->string()); 400 ASSERT_TRUE(UTF8ToUTF16("C") == strings[2]->string());
401 ASSERT_TRUE(UTF8ToUTF16("d") == strings[3]->string()); 401 ASSERT_TRUE(UTF8ToUTF16("d") == strings[3]->string());
402 STLDeleteElements(&strings); 402 base::STLDeleteElements(&strings);
403 } 403 }
404 404
405 /** 405 /**
406 * Helper method for validating strings that require direcitonal markup. 406 * Helper method for validating strings that require direcitonal markup.
407 * Checks that parentheses are enclosed in appropriate direcitonal markers. 407 * Checks that parentheses are enclosed in appropriate direcitonal markers.
408 */ 408 */
409 void CheckUiDisplayNameForLocale(const std::string& locale, 409 void CheckUiDisplayNameForLocale(const std::string& locale,
410 const std::string& display_locale, 410 const std::string& display_locale,
411 bool is_rtl) { 411 bool is_rtl) {
412 EXPECT_EQ(true, base::i18n::IsRTL()); 412 EXPECT_EQ(true, base::i18n::IsRTL());
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin")); 567 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("Latin"));
568 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German")); 568 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("German"));
569 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR")); 569 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("pt--BR"));
570 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia")); 570 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("sl-macedonia"));
571 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@")); 571 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("@"));
572 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@")); 572 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@"));
573 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x")); 573 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x"));
574 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x=")); 574 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@x="));
575 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y")); 575 EXPECT_FALSE(l10n_util::IsValidLocaleSyntax("en-US@=y"));
576 } 576 }
OLDNEW
« no previous file with comments | « ui/base/ime/win/tsf_input_scope.cc ('k') | ui/base/models/tree_node_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698