OLD | NEW |
(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 |
OLD | NEW |