Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(519)

Side by Side Diff: chromecast/base/cast_sys_info_dummy.h

Issue 1466003003: [Chromecast] Add setters to CastSysInfoDummy. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add ForTesting. Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chromecast/base/cast_sys_info_dummy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_ 5 #ifndef CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
6 #define CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_ 6 #define CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
7 7
8 // Note(slan): This file is needed by internal targets which cannot depend on 8 // Note(slan): This file is needed by internal targets which cannot depend on
9 // "//base". Amend this include with a comment so gn check ignores it. 9 // "//base". Amend this include with a comment so gn check ignores it.
10 #include "base/macros.h" // nogncheck 10 #include "base/macros.h" // nogncheck
11 #include "chromecast/public/cast_sys_info.h" 11 #include "chromecast/public/cast_sys_info.h"
12 12
13 namespace chromecast { 13 namespace chromecast {
14 14
15 // Dummy implementation of CastSysInfo. Fields can be overwritten for test.
15 class CastSysInfoDummy : public CastSysInfo { 16 class CastSysInfoDummy : public CastSysInfo {
16 public: 17 public:
17 CastSysInfoDummy(); 18 CastSysInfoDummy();
18 ~CastSysInfoDummy() override; 19 ~CastSysInfoDummy() override;
19 20
20 // CastSysInfo implementation: 21 // CastSysInfo implementation:
21 BuildType GetBuildType() override; 22 BuildType GetBuildType() override;
22 std::string GetSystemReleaseChannel() override; 23 std::string GetSystemReleaseChannel() override;
23 std::string GetSerialNumber() override; 24 std::string GetSerialNumber() override;
24 std::string GetProductName() override; 25 std::string GetProductName() override;
25 std::string GetDeviceModel() override; 26 std::string GetDeviceModel() override;
26 std::string GetBoardName() override; 27 std::string GetBoardName() override;
27 std::string GetBoardRevision() override; 28 std::string GetBoardRevision() override;
28 std::string GetManufacturer() override; 29 std::string GetManufacturer() override;
29 std::string GetSystemBuildNumber() override; 30 std::string GetSystemBuildNumber() override;
30 std::string GetFactoryCountry() override; 31 std::string GetFactoryCountry() override;
31 std::string GetFactoryLocale(std::string* second_locale) override; 32 std::string GetFactoryLocale(std::string* second_locale) override;
32 std::string GetWifiInterface() override; 33 std::string GetWifiInterface() override;
33 std::string GetApInterface() override; 34 std::string GetApInterface() override;
34 std::string GetGlVendor() override; 35 std::string GetGlVendor() override;
35 std::string GetGlRenderer() override; 36 std::string GetGlRenderer() override;
36 std::string GetGlVersion() override; 37 std::string GetGlVersion() override;
37 38
39 void SetBuildTypeForTesting(BuildType build_type);
40 void SetSystemReleaseChannelForTesting(
41 const std::string& system_release_channel);
42 void SetSerialNumberForTesting(const std::string& serial_number);
43 void SetProductNameForTesting(const std::string& product_name);
44 void SetDeviceModelForTesting(const std::string& device_model);
45 void SetBoardNameForTesting(const std::string& board_name);
46 void SetBoardRevisionForTesting(const std::string& board_revision);
47 void SetManufacturerForTesting(const std::string& manufacturer);
48 void SetSystemBuildNumberForTesting(const std::string& system_build_number);
49 void SetFactoryCountryForTesting(const std::string& factory_country);
50 void SetFactoryLocaleForTesting(const std::string& factory_locale);
51 void SetWifiInterfaceForTesting(const std::string& wifi_interface);
52 void SetApInterfaceForTesting(const std::string& ap_interface);
53 void SetGlVendorForTesting(const std::string& gl_vendor);
54 void SetGlRendererForTesting(const std::string& gl_renderer);
55 void SetGlVersionForTesting(const std::string& gl_version);
56
38 private: 57 private:
58 BuildType build_type_;
59 std::string system_release_channel_;
60 std::string serial_number_;
61 std::string product_name_;
62 std::string device_model_;
63 std::string board_name_;
64 std::string board_revision_;
65 std::string manufacturer_;
66 std::string system_build_number_;
67 std::string factory_country_;
68 std::string factory_locale_;
69 std::string wifi_interface_;
70 std::string ap_interface_;
71 std::string gl_vendor_;
72 std::string gl_renderer_;
73 std::string gl_version_;
74
39 DISALLOW_COPY_AND_ASSIGN(CastSysInfoDummy); 75 DISALLOW_COPY_AND_ASSIGN(CastSysInfoDummy);
40 }; 76 };
41 77
42 } // namespace chromecast 78 } // namespace chromecast
43 79
44 #endif // CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_ 80 #endif // CHROMECAST_BASE_CAST_SYS_INFO_DUMMY_H_
OLDNEW
« no previous file with comments | « no previous file | chromecast/base/cast_sys_info_dummy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698