| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ | 5 #ifndef CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |
| 6 #define CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ | 6 #define CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chromeos/chromeos_export.h" | 12 #include "chromeos/chromeos_export.h" |
| 13 #include "chromeos/system/statistics_provider.h" | 13 #include "chromeos/system/statistics_provider.h" |
| 14 | 14 |
| 15 namespace chromeos { | 15 namespace chromeos { |
| 16 namespace system { | 16 namespace system { |
| 17 | 17 |
| 18 // A fake StatisticsProvider implementation that is useful in tests. | 18 // A fake StatisticsProvider implementation that is useful in tests. |
| 19 class CHROMEOS_EXPORT FakeStatisticsProvider : public StatisticsProvider { | 19 class CHROMEOS_EXPORT FakeStatisticsProvider : public StatisticsProvider { |
| 20 public: | 20 public: |
| 21 FakeStatisticsProvider(); | 21 FakeStatisticsProvider(); |
| 22 ~FakeStatisticsProvider() override; | 22 ~FakeStatisticsProvider() override; |
| 23 | 23 |
| 24 // StatisticsProvider implementation: | 24 // StatisticsProvider implementation: |
| 25 void StartLoadingMachineStatistics( | 25 void StartLoadingMachineStatistics(bool load_oem_manifest) override; |
| 26 const scoped_refptr<base::TaskRunner>& file_task_runner, | |
| 27 bool load_oem_manifest) override; | |
| 28 bool GetMachineStatistic(const std::string& name, | 26 bool GetMachineStatistic(const std::string& name, |
| 29 std::string* result) override; | 27 std::string* result) override; |
| 30 bool GetMachineFlag(const std::string& name, bool* result) override; | 28 bool GetMachineFlag(const std::string& name, bool* result) override; |
| 31 void Shutdown() override; | 29 void Shutdown() override; |
| 32 bool IsRunningOnVm() override; | 30 bool IsRunningOnVm() override; |
| 33 | 31 |
| 34 void SetMachineStatistic(const std::string& key, const std::string& value); | 32 void SetMachineStatistic(const std::string& key, const std::string& value); |
| 35 void ClearMachineStatistic(const std::string& key); | 33 void ClearMachineStatistic(const std::string& key); |
| 36 void SetMachineFlag(const std::string& key, bool value); | 34 void SetMachineFlag(const std::string& key, bool value); |
| 37 void ClearMachineFlag(const std::string& key); | 35 void ClearMachineFlag(const std::string& key); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 52 ~ScopedFakeStatisticsProvider() override; | 50 ~ScopedFakeStatisticsProvider() override; |
| 53 | 51 |
| 54 private: | 52 private: |
| 55 DISALLOW_COPY_AND_ASSIGN(ScopedFakeStatisticsProvider); | 53 DISALLOW_COPY_AND_ASSIGN(ScopedFakeStatisticsProvider); |
| 56 }; | 54 }; |
| 57 | 55 |
| 58 } // namespace system | 56 } // namespace system |
| 59 } // namespace chromeos | 57 } // namespace chromeos |
| 60 | 58 |
| 61 #endif // CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ | 59 #endif // CHROMEOS_SYSTEM_FAKE_STATISTICS_PROVIDER_H_ |
| OLD | NEW |