File: cast_sys_info_dummy.h

package info (click to toggle)
chromium 120.0.6099.224-1~deb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,112,112 kB
  • sloc: cpp: 32,907,025; ansic: 8,148,123; javascript: 3,679,536; python: 2,031,248; asm: 959,718; java: 804,675; xml: 617,256; sh: 111,417; objc: 100,835; perl: 88,443; cs: 53,032; makefile: 29,579; fortran: 24,137; php: 21,162; tcl: 21,147; sql: 20,809; ruby: 17,735; pascal: 12,864; yacc: 8,045; lisp: 3,388; lex: 1,323; ada: 727; awk: 329; jsp: 267; csh: 117; exp: 43; sed: 37
file content (79 lines) | stat: -rw-r--r-- 3,027 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
#define CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_

#include <vector>

// Note(slan): This file is needed by internal targets which cannot depend on
// "//base". Amend this include with a comment so gn check ignores it.
#include "chromecast/public/cast_sys_info.h"

namespace chromecast {

// Dummy implementation of CastSysInfo. Fields can be overwritten for test.
class CastSysInfoDummy : public CastSysInfo {
 public:
  CastSysInfoDummy();
  CastSysInfoDummy(const std::string& sys_info_file);

  CastSysInfoDummy(const CastSysInfoDummy&) = delete;
  CastSysInfoDummy& operator=(const CastSysInfoDummy&) = delete;

  ~CastSysInfoDummy() override;

  // CastSysInfo implementation:
  BuildType GetBuildType() override;
  std::string GetSystemReleaseChannel() override;
  std::string GetSerialNumber() override;
  std::string GetProductName() override;
  std::string GetDeviceModel() override;
  std::string GetBoardName() override;
  std::string GetBoardRevision() override;
  std::string GetManufacturer() override;
  std::string GetSystemBuildNumber() override;
  std::string GetFactoryCountry() override;
  std::vector<std::string> GetFactoryLocaleList() override;
  std::string GetWifiInterface() override;
  std::string GetApInterface() override;
  std::string GetProductSsidSuffix() override;

  void SetBuildTypeForTesting(BuildType build_type);
  void SetSystemReleaseChannelForTesting(
      const std::string& system_release_channel);
  void SetSerialNumberForTesting(const std::string& serial_number);
  void SetProductNameForTesting(const std::string& product_name);
  void SetDeviceModelForTesting(const std::string& device_model);
  void SetBoardNameForTesting(const std::string& board_name);
  void SetBoardRevisionForTesting(const std::string& board_revision);
  void SetManufacturerForTesting(const std::string& manufacturer);
  void SetSystemBuildNumberForTesting(const std::string& system_build_number);
  void SetFactoryCountryForTesting(const std::string& factory_country);
  void SetFactoryLocaleListForTesting(
      const std::vector<std::string>& factory_locale_list);
  void SetWifiInterfaceForTesting(const std::string& wifi_interface);
  void SetApInterfaceForTesting(const std::string& ap_interface);
  void SetProductSsidSuffixForTesting(const std::string& ssid_suffix);

 private:
  BuildType build_type_;
  std::string system_release_channel_;
  std::string serial_number_;
  std::string product_name_;
  std::string device_model_;
  std::string board_name_;
  std::string board_revision_;
  std::string manufacturer_;
  std::string system_build_number_;
  std::string factory_country_;
  std::vector<std::string> factory_locale_list_;
  std::string wifi_interface_;
  std::string ap_interface_;
  std::string ssid_suffix_;
};

}  // namespace chromecast

#endif  // CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_