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

Side by Side Diff: chromeos/network/onc/onc_validator_unittest.cc

Issue 61903002: ChromeOS: Add more host verification options for OpenVpn. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Made 'type' optional. More tests. Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chromeos/network/onc/onc_validator.h" 5 #include "chromeos/network/onc/onc_validator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 &kNetworkConfigurationSignature, 158 &kNetworkConfigurationSignature,
159 true), 159 true),
160 OncParams("ethernet.onc", 160 OncParams("ethernet.onc",
161 &kNetworkConfigurationSignature, 161 &kNetworkConfigurationSignature,
162 true), 162 true),
163 OncParams("ethernet_with_eap.onc", 163 OncParams("ethernet_with_eap.onc",
164 &kNetworkConfigurationSignature, 164 &kNetworkConfigurationSignature,
165 true), 165 true),
166 OncParams("translation_of_shill_wifi_with_state.onc", 166 OncParams("translation_of_shill_wifi_with_state.onc",
167 &kNetworkWithStateSignature, 167 &kNetworkWithStateSignature,
168 false),
169 OncParams("valid_openvpn_with_cert_pems.onc",
170 &kNetworkConfigurationSignature,
168 false))); 171 false)));
169 172
170 namespace { 173 namespace {
171 174
172 struct RepairParams { 175 struct RepairParams {
173 // Both arguments are strings to identify the object that is expected as the 176 // Both arguments are strings to identify the object that is expected as the
174 // validation result. They may either be used as filenames or as dictionary 177 // validation result. They may either be used as filenames or as dictionary
175 // keys. 178 // keys.
176 RepairParams(std::string strict_repaired, 179 RepairParams(std::string strict_repaired,
177 std::string liberal_repaired) 180 std::string liberal_repaired)
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 // configuration. 288 // configuration.
286 std::make_pair(OncParams("network-state-field", 289 std::make_pair(OncParams("network-state-field",
287 &kNetworkConfigurationSignature, 290 &kNetworkConfigurationSignature,
288 false), 291 false),
289 RepairParams("", "network-repaired")), 292 RepairParams("", "network-repaired")),
290 std::make_pair(OncParams("network-nested-state-field", 293 std::make_pair(OncParams("network-nested-state-field",
291 &kNetworkConfigurationSignature, 294 &kNetworkConfigurationSignature,
292 false), 295 false),
293 RepairParams("", 296 RepairParams("",
294 "network-nested-state-field-repaired")), 297 "network-nested-state-field-repaired")),
298 std::make_pair(OncParams("openvpn-missing-verify-x509-name",
299 &kNetworkConfigurationSignature, false),
300 RepairParams("", "openvpn-missing-verify-x509-name")),
295 std::make_pair(OncParams("toplevel-with-repairable-networks", 301 std::make_pair(OncParams("toplevel-with-repairable-networks",
296 &kToplevelConfigurationSignature, 302 &kToplevelConfigurationSignature,
297 false, 303 false,
298 ::onc::ONC_SOURCE_DEVICE_POLICY), 304 ::onc::ONC_SOURCE_DEVICE_POLICY),
299 RepairParams("", "toplevel-with-repaired-networks")))); 305 RepairParams("", "toplevel-with-repaired-networks"))));
300 306
301 // Strict and liberal validator repair identically. 307 // Strict and liberal validator repair identically.
302 INSTANTIATE_TEST_CASE_P( 308 INSTANTIATE_TEST_CASE_P(
303 StrictAndLiberalRepairIdentically, 309 StrictAndLiberalRepairIdentically,
304 ONCValidatorTestRepairable, 310 ONCValidatorTestRepairable,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 RepairParams("", "")), 365 RepairParams("", "")),
360 std::make_pair(OncParams("network-wrong-type", 366 std::make_pair(OncParams("network-wrong-type",
361 &kNetworkConfigurationSignature, false), 367 &kNetworkConfigurationSignature, false),
362 RepairParams("", "")), 368 RepairParams("", "")),
363 std::make_pair(OncParams("managed-network-wrong-type", 369 std::make_pair(OncParams("managed-network-wrong-type",
364 &kNetworkConfigurationSignature, true), 370 &kNetworkConfigurationSignature, true),
365 RepairParams("", "")), 371 RepairParams("", "")),
366 std::make_pair(OncParams("network-with-client-cert-pattern", 372 std::make_pair(OncParams("network-with-client-cert-pattern",
367 &kNetworkConfigurationSignature, true, 373 &kNetworkConfigurationSignature, true,
368 ::onc::ONC_SOURCE_DEVICE_POLICY), 374 ::onc::ONC_SOURCE_DEVICE_POLICY),
369 RepairParams("", "")))); 375 RepairParams("", "")),
376 std::make_pair(OncParams("openvpn-invalid-verify-x509-type",
377 &kNetworkConfigurationSignature, false),
378 RepairParams("", ""))
379 ));
370 380
371 } // namespace onc 381 } // namespace onc
372 } // namespace chromeos 382 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698