cast_sys_info_dummy.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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. #ifndef CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
  5. #define CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
  6. #include <vector>
  7. // Note(slan): This file is needed by internal targets which cannot depend on
  8. // "//base". Amend this include with a comment so gn check ignores it.
  9. #include "chromecast/public/cast_sys_info.h"
  10. namespace chromecast {
  11. // Dummy implementation of CastSysInfo. Fields can be overwritten for test.
  12. class CastSysInfoDummy : public CastSysInfo {
  13. public:
  14. CastSysInfoDummy();
  15. CastSysInfoDummy(const std::string& sys_info_file);
  16. CastSysInfoDummy(const CastSysInfoDummy&) = delete;
  17. CastSysInfoDummy& operator=(const CastSysInfoDummy&) = delete;
  18. ~CastSysInfoDummy() override;
  19. // CastSysInfo implementation:
  20. BuildType GetBuildType() override;
  21. std::string GetSystemReleaseChannel() override;
  22. std::string GetSerialNumber() override;
  23. std::string GetProductName() override;
  24. std::string GetDeviceModel() override;
  25. std::string GetBoardName() override;
  26. std::string GetBoardRevision() override;
  27. std::string GetManufacturer() override;
  28. std::string GetSystemBuildNumber() override;
  29. std::string GetFactoryCountry() override;
  30. std::vector<std::string> GetFactoryLocaleList() override;
  31. std::string GetWifiInterface() override;
  32. std::string GetApInterface() override;
  33. std::string GetProductSsidSuffix() override;
  34. void SetBuildTypeForTesting(BuildType build_type);
  35. void SetSystemReleaseChannelForTesting(
  36. const std::string& system_release_channel);
  37. void SetSerialNumberForTesting(const std::string& serial_number);
  38. void SetProductNameForTesting(const std::string& product_name);
  39. void SetDeviceModelForTesting(const std::string& device_model);
  40. void SetBoardNameForTesting(const std::string& board_name);
  41. void SetBoardRevisionForTesting(const std::string& board_revision);
  42. void SetManufacturerForTesting(const std::string& manufacturer);
  43. void SetSystemBuildNumberForTesting(const std::string& system_build_number);
  44. void SetFactoryCountryForTesting(const std::string& factory_country);
  45. void SetFactoryLocaleListForTesting(
  46. const std::vector<std::string>& factory_locale_list);
  47. void SetWifiInterfaceForTesting(const std::string& wifi_interface);
  48. void SetApInterfaceForTesting(const std::string& ap_interface);
  49. void SetProductSsidSuffixForTesting(const std::string& ssid_suffix);
  50. private:
  51. BuildType build_type_;
  52. std::string system_release_channel_;
  53. std::string serial_number_;
  54. std::string product_name_;
  55. std::string device_model_;
  56. std::string board_name_;
  57. std::string board_revision_;
  58. std::string manufacturer_;
  59. std::string system_build_number_;
  60. std::string factory_country_;
  61. std::vector<std::string> factory_locale_list_;
  62. std::string wifi_interface_;
  63. std::string ap_interface_;
  64. std::string ssid_suffix_;
  65. };
  66. } // namespace chromecast
  67. #endif // CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_