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

Side by Side Diff: chrome/browser/chromeos/policy/network_configuration_updater_unittest.cc

Issue 2418833003: Remove use of deprecated base::ListValue::Append(Value*) overload in //chrome/browser/chromeos (Closed)
Patch Set: use-after-move Created 4 years, 2 months 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 " \"Type\": \"UnencryptedConfiguration\"" 178 " \"Type\": \"UnencryptedConfiguration\""
179 "}"; 179 "}";
180 180
181 std::string ValueToString(const base::Value& value) { 181 std::string ValueToString(const base::Value& value) {
182 std::stringstream str; 182 std::stringstream str;
183 str << value; 183 str << value;
184 return str.str(); 184 return str.str();
185 } 185 }
186 186
187 void AppendAll(const base::ListValue& from, base::ListValue* to) { 187 void AppendAll(const base::ListValue& from, base::ListValue* to) {
188 for (base::ListValue::const_iterator it = from.begin(); it != from.end(); 188 for (const auto& value : from)
189 ++it) { 189 to->Append(value->CreateDeepCopy());
190 to->Append((*it)->DeepCopy());
191 }
192 } 190 }
193 191
194 // Matcher to match base::Value. 192 // Matcher to match base::Value.
195 MATCHER_P(IsEqualTo, 193 MATCHER_P(IsEqualTo,
196 value, 194 value,
197 std::string(negation ? "isn't" : "is") + " equal to " + 195 std::string(negation ? "isn't" : "is") + " equal to " +
198 ValueToString(*value)) { 196 ValueToString(*value)) {
199 return value->Equals(&arg); 197 return value->Equals(&arg);
200 } 198 }
201 199
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 EXPECT_EQ(ExpectedImportCertificatesCallCount(), 672 EXPECT_EQ(ExpectedImportCertificatesCallCount(),
675 certificate_importer_->GetAndResetImportCount()); 673 certificate_importer_->GetAndResetImportCount());
676 } 674 }
677 675
678 INSTANTIATE_TEST_CASE_P(NetworkConfigurationUpdaterTestWithParamInstance, 676 INSTANTIATE_TEST_CASE_P(NetworkConfigurationUpdaterTestWithParamInstance,
679 NetworkConfigurationUpdaterTestWithParam, 677 NetworkConfigurationUpdaterTestWithParam,
680 testing::Values(key::kDeviceOpenNetworkConfiguration, 678 testing::Values(key::kDeviceOpenNetworkConfiguration,
681 key::kOpenNetworkConfiguration)); 679 key::kOpenNetworkConfiguration));
682 680
683 } // namespace policy 681 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698