resources_unittest.cc 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #include "remoting/host/resources.h"
  5. #include "build/branding_buildflags.h"
  6. #include "build/build_config.h"
  7. #include "remoting/base/string_resources.h"
  8. #include "testing/gtest/include/gtest/gtest.h"
  9. #include "ui/base/l10n/l10n_util.h"
  10. namespace remoting {
  11. class ResourcesTest : public testing::Test {
  12. protected:
  13. ResourcesTest() : resources_available_(false) {}
  14. void SetUp() override { resources_available_ = LoadResources("en-US"); }
  15. void TearDown() override { UnloadResources(); }
  16. bool resources_available_;
  17. };
  18. // TODO(alexeypa): Reenable the test once http://crbug.com/269143 (ChromeOS) and
  19. // http://crbug.com/268043 (MacOS) are fixed.
  20. TEST_F(ResourcesTest, DISABLED_ProductName) {
  21. #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
  22. std::string expected_product_name = "Chrome Remote Desktop";
  23. #else // BUILDFLAG(GOOGLE_CHROME_BRANDING)
  24. std::string expected_product_name = "Chromoting";
  25. #endif // BUILDFLAGdefined(GOOGLE_CRANDING)
  26. // Chrome-style i18n is not used on Windows or Android.
  27. #if BUILDFLAG(IS_WIN) || BUILDFLAG(IS_ANDROID)
  28. EXPECT_FALSE(resources_available_);
  29. #else
  30. EXPECT_TRUE(resources_available_);
  31. #endif
  32. if (resources_available_) {
  33. EXPECT_EQ(expected_product_name,
  34. l10n_util::GetStringUTF8(IDS_PRODUCT_NAME));
  35. }
  36. }
  37. } // namespace remoting