1 // Copyright 2019 The Chromium Authors 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 "base/i18n/icu_util.h" 6 7 #include "base/test/icu_test_util.h" 8 #include "build/build_config.h" 9 #include "testing/gtest/include/gtest/gtest.h" 10 11 #if !BUILDFLAG(IS_NACL) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE) && \ 12 (BUILDFLAG(IS_CHROMEOS_LACROS) || BUILDFLAG(IS_ANDROID)) 13 14 namespace base::i18n { 15 16 class IcuUtilTest : public testing::Test { 17 protected: SetUp()18 void SetUp() override { ResetGlobalsForTesting(); } TearDown()19 void TearDown() override { 20 ResetGlobalsForTesting(); 21 22 // ICU must be set back up in case e.g. a log statement that formats times 23 // uses it. 24 test::InitializeICUForTesting(); 25 } 26 }; 27 TEST_F(IcuUtilTest,InitializeIcuSucceeds)28TEST_F(IcuUtilTest, InitializeIcuSucceeds) { 29 bool success = InitializeICU(); 30 31 ASSERT_TRUE(success); 32 } 33 34 } // namespace base::i18n 35 36 #endif 37