1 // Copyright 2020 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
5 #include "components/arc/test/fake_cros_config.h"
6
7 namespace arc {
8
9 FakeCrosConfig::FakeCrosConfig() = default;
10
11 FakeCrosConfig::~FakeCrosConfig() = default;
12
GetString(const std::string & path,const std::string & property,std::string * val_out)13 bool FakeCrosConfig::GetString(const std::string& path,
14 const std::string& property,
15 std::string* val_out) {
16 auto it = overrides_.find(property);
17 if (it != overrides_.end()) {
18 *val_out = it->second;
19 return true;
20 }
21 return arc::CrosConfig::GetString(path, property, val_out);
22 }
23
SetString(const std::string & path,const std::string & property,const std::string & value)24 void FakeCrosConfig::SetString(const std::string& path,
25 const std::string& property,
26 const std::string& value) {
27 overrides_.emplace(property, value);
28 }
29
30 } // namespace arc
31