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

Side by Side Diff: components/autofill/core/common/autofill_l10n_util_unittest.cc

Issue 1457393003: [Autofill] Guard against the initialization failure of ICU Collator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: accepted rewrite Created 5 years 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 | « components/autofill/core/common/autofill_l10n_util.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "components/autofill/core/common/autofill_l10n_util.h"
6
7 #include "base/test/histogram_tester.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9 #include "third_party/icu/source/common/unicode/locid.h"
10
11 namespace autofill {
12 namespace l10n {
13
14 // Test the success in the creation of the ICU Collator.
15 TEST(CaseInsensitiveCompareTest, IcuCollatorCreation_Success) {
16 base::HistogramTester histogram_tester;
17 CaseInsensitiveCompare compare;
18 histogram_tester.ExpectUniqueSample("Autofill.IcuCollatorCreationSuccess",
19 true, 1);
20 }
21
22 // Test the failure in creating the ICU Collator.
23 TEST(CaseInsensitiveCompareTest, IcuCollatorCreation_FailureBadLocale) {
24 // Setting the locale to a bogus value.
25 icu::Locale bogusLocale = icu::Locale::createFromName("bogus");
26 bogusLocale.setToBogus();
27
28 base::HistogramTester histogram_tester;
29 CaseInsensitiveCompare compare(bogusLocale);
30 histogram_tester.ExpectUniqueSample("Autofill.IcuCollatorCreationSuccess",
31 false, 1);
32 }
33
34 } // namespace l10n
35 } // namespace autofill
OLDNEW
« no previous file with comments | « components/autofill/core/common/autofill_l10n_util.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698