icu_util_unittest.cc 951 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright (c) 2019 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. #include "base/i18n/icu_util.h"
  5. #include "build/build_config.h"
  6. #include "testing/gtest/include/gtest/gtest.h"
  7. #if !BUILDFLAG(IS_NACL)
  8. #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
  9. namespace base::i18n {
  10. class IcuUtilTest : public testing::Test {
  11. protected:
  12. void SetUp() override { ResetGlobalsForTesting(); }
  13. };
  14. #if BUILDFLAG(IS_CHROMEOS_LACROS)
  15. TEST_F(IcuUtilTest, InitializeIcuSucceeds) {
  16. bool success = InitializeICU();
  17. ASSERT_TRUE(success);
  18. }
  19. #endif // BUILDFLAG(IS_CHROMEOS_LACROS)
  20. #if BUILDFLAG(IS_ANDROID)
  21. TEST_F(IcuUtilTest, InitializeIcuSucceeds) {
  22. bool success = InitializeICU();
  23. ASSERT_TRUE(success);
  24. }
  25. #endif // BUILDFLAG(IS_ANDROID)
  26. } // namespace base::i18n
  27. #endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
  28. #endif // !BUILDFLAG(IS_NACL)