| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |