OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" | 5 #include "chrome/browser/chromeos/settings/scoped_cros_settings_test_helper.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 stub_settings_provider_ptr_->SetCurrentUserIsOwner(owner); | 73 stub_settings_provider_ptr_->SetCurrentUserIsOwner(owner); |
74 } | 74 } |
75 | 75 |
76 void ScopedCrosSettingsTestHelper::Set(const std::string& path, | 76 void ScopedCrosSettingsTestHelper::Set(const std::string& path, |
77 const base::Value& in_value) { | 77 const base::Value& in_value) { |
78 stub_settings_provider_ptr_->Set(path, in_value); | 78 stub_settings_provider_ptr_->Set(path, in_value); |
79 } | 79 } |
80 | 80 |
81 void ScopedCrosSettingsTestHelper::SetBoolean(const std::string& path, | 81 void ScopedCrosSettingsTestHelper::SetBoolean(const std::string& path, |
82 bool in_value) { | 82 bool in_value) { |
83 Set(path, base::FundamentalValue(in_value)); | 83 Set(path, base::Value(in_value)); |
84 } | 84 } |
85 | 85 |
86 void ScopedCrosSettingsTestHelper::SetInteger(const std::string& path, | 86 void ScopedCrosSettingsTestHelper::SetInteger(const std::string& path, |
87 int in_value) { | 87 int in_value) { |
88 Set(path, base::FundamentalValue(in_value)); | 88 Set(path, base::Value(in_value)); |
89 } | 89 } |
90 | 90 |
91 void ScopedCrosSettingsTestHelper::SetDouble(const std::string& path, | 91 void ScopedCrosSettingsTestHelper::SetDouble(const std::string& path, |
92 double in_value) { | 92 double in_value) { |
93 Set(path, base::FundamentalValue(in_value)); | 93 Set(path, base::Value(in_value)); |
94 } | 94 } |
95 | 95 |
96 void ScopedCrosSettingsTestHelper::SetString(const std::string& path, | 96 void ScopedCrosSettingsTestHelper::SetString(const std::string& path, |
97 const std::string& in_value) { | 97 const std::string& in_value) { |
98 Set(path, base::StringValue(in_value)); | 98 Set(path, base::StringValue(in_value)); |
99 } | 99 } |
100 | 100 |
101 void ScopedCrosSettingsTestHelper::StoreCachedDeviceSetting( | 101 void ScopedCrosSettingsTestHelper::StoreCachedDeviceSetting( |
102 const std::string& path) { | 102 const std::string& path) { |
103 const base::Value* const value = stub_settings_provider_ptr_->Get(path); | 103 const base::Value* const value = stub_settings_provider_ptr_->Get(path); |
(...skipping 22 matching lines...) Expand all Loading... |
126 | 126 |
127 void ScopedCrosSettingsTestHelper::Initialize(bool create_settings_service) { | 127 void ScopedCrosSettingsTestHelper::Initialize(bool create_settings_service) { |
128 if (create_settings_service) { | 128 if (create_settings_service) { |
129 CHECK(!DeviceSettingsService::IsInitialized()); | 129 CHECK(!DeviceSettingsService::IsInitialized()); |
130 test_device_settings_service_.reset(new ScopedTestDeviceSettingsService()); | 130 test_device_settings_service_.reset(new ScopedTestDeviceSettingsService()); |
131 test_cros_settings_.reset(new ScopedTestCrosSettings()); | 131 test_cros_settings_.reset(new ScopedTestCrosSettings()); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 } // namespace chromeos | 135 } // namespace chromeos |
OLD | NEW |