xref: /aosp_15_r20/external/cronet/base/i18n/icu_util_unittest.cc (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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)28 TEST_F(IcuUtilTest, InitializeIcuSucceeds) {
29   bool success = InitializeICU();
30 
31   ASSERT_TRUE(success);
32 }
33 
34 }  // namespace base::i18n
35 
36 #endif
37