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

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

Issue 1019033002: Add an ONC property for the third-party VPN provider extension ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed browser tests. Created 5 years, 9 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 (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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 &kNetworkWithStateSignature, 201 &kNetworkWithStateSignature,
202 false), 202 false),
203 OncParams("translation_of_shill_wimax_with_state.onc", 203 OncParams("translation_of_shill_wimax_with_state.onc",
204 &kNetworkWithStateSignature, 204 &kNetworkWithStateSignature,
205 false), 205 false),
206 OncParams("valid_openvpn_with_cert_pems.onc", 206 OncParams("valid_openvpn_with_cert_pems.onc",
207 &kNetworkConfigurationSignature, 207 &kNetworkConfigurationSignature,
208 false), 208 false),
209 OncParams("openvpn_with_password.onc", 209 OncParams("openvpn_with_password.onc",
210 &kNetworkConfigurationSignature, 210 &kNetworkConfigurationSignature,
211 false),
212 OncParams("third_party_vpn.onc",
213 &kNetworkConfigurationSignature,
211 false))); 214 false)));
212 215
213 namespace { 216 namespace {
214 217
215 struct RepairParams { 218 struct RepairParams {
216 RepairParams(const std::string& strict_repaired, 219 RepairParams(const std::string& strict_repaired,
217 const std::string& liberal_repaired, 220 const std::string& liberal_repaired,
218 bool liberal_valid) 221 bool liberal_valid)
219 : location_of_strict_repaired(strict_repaired), 222 : location_of_strict_repaired(strict_repaired),
220 location_of_liberal_repaired(liberal_repaired), 223 location_of_liberal_repaired(liberal_repaired),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 &kNetworkConfigurationSignature, 344 &kNetworkConfigurationSignature,
342 false), 345 false),
343 ExpectStrictNotValid("")), 346 ExpectStrictNotValid("")),
344 std::make_pair(OncParams("managed-network-missing-required", 347 std::make_pair(OncParams("managed-network-missing-required",
345 &kNetworkConfigurationSignature, 348 &kNetworkConfigurationSignature,
346 true), 349 true),
347 ExpectStrictNotValid("")), 350 ExpectStrictNotValid("")),
348 std::make_pair(OncParams("openvpn-missing-verify-x509-name", 351 std::make_pair(OncParams("openvpn-missing-verify-x509-name",
349 &kNetworkConfigurationSignature, 352 &kNetworkConfigurationSignature,
350 false), 353 false),
354 ExpectStrictNotValid("")),
355 std::make_pair(OncParams("third-party-vpn-missing-extension-id",
356 &kNetworkConfigurationSignature,
357 false),
351 ExpectStrictNotValid("")))); 358 ExpectStrictNotValid(""))));
352 359
353 // Strict validator returns INVALID. Liberal validator repairs. 360 // Strict validator returns INVALID. Liberal validator repairs.
354 INSTANTIATE_TEST_CASE_P( 361 INSTANTIATE_TEST_CASE_P(
355 StrictInvalidLiberalRepair, 362 StrictInvalidLiberalRepair,
356 ONCValidatorTestRepairable, 363 ONCValidatorTestRepairable,
357 ::testing::Values( 364 ::testing::Values(
358 std::make_pair(OncParams("network-unknown-fieldname", 365 std::make_pair(OncParams("network-unknown-fieldname",
359 &kNetworkConfigurationSignature, 366 &kNetworkConfigurationSignature,
360 false), 367 false),
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
526 true, 533 true,
527 ::onc::ONC_SOURCE_DEVICE_POLICY), 534 ::onc::ONC_SOURCE_DEVICE_POLICY),
528 ExpectBothNotValid("", "")), 535 ExpectBothNotValid("", "")),
529 std::make_pair(OncParams("openvpn-invalid-verify-x509-type", 536 std::make_pair(OncParams("openvpn-invalid-verify-x509-type",
530 &kNetworkConfigurationSignature, 537 &kNetworkConfigurationSignature,
531 false), 538 false),
532 ExpectBothNotValid("", "")))); 539 ExpectBothNotValid("", ""))));
533 540
534 } // namespace onc 541 } // namespace onc
535 } // namespace chromeos 542 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_validator.cc ('k') | chromeos/test/data/network/invalid_settings_with_repairs.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698