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

Unified Diff: chromeos/network/onc/onc_validator_unittest.cc

Issue 11488008: Adding more ONC validation tests. (Closed) Base URL: http://git.chromium.org/chromium/src.git@reject_network_independently
Patch Set: Rebased. Created 8 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chromeos/test/data/network/invalid_settings_with_repairs.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/onc/onc_validator_unittest.cc
diff --git a/chromeos/network/onc/onc_validator_unittest.cc b/chromeos/network/onc/onc_validator_unittest.cc
index 06f35dc0e0cd8bf4cd4ac52e0844b2bb3967c55e..105e9a0441f690ad79ccc0bc59df426a4b52bfbd 100644
--- a/chromeos/network/onc/onc_validator_unittest.cc
+++ b/chromeos/network/onc/onc_validator_unittest.cc
@@ -127,7 +127,14 @@ TEST_P(ONCValidatorValidTest, LiberalValidationValid) {
INSTANTIATE_TEST_CASE_P(
ONCValidatorValidTest,
ONCValidatorValidTest,
- ::testing::Values(OncParams("managed_toplevel.onc",
+ ::testing::Values(OncParams("managed_toplevel1.onc",
+ &kToplevelConfigurationSignature,
+ true),
+ OncParams("managed_toplevel2.onc",
+ &kToplevelConfigurationSignature,
+ true),
+ // Test a configuration generated by CPanel.
+ OncParams("managed_toplevel_cpanel.onc",
&kToplevelConfigurationSignature,
true),
OncParams("encrypted.onc",
@@ -276,6 +283,16 @@ INSTANTIATE_TEST_CASE_P(
false),
RepairParams("network-repaired", "network-repaired"))));
+// Strict and liberal validator both repair, but with different results.
+INSTANTIATE_TEST_CASE_P(
+ StrictAndLiberalRepairDifferently,
+ ONCValidatorTestRepairable,
+ ::testing::Values(
+ std::make_pair(OncParams("toplevel-with-nested-warning",
+ &kToplevelConfigurationSignature,
+ false),
+ RepairParams("toplevel-empty", "toplevel-repaired"))));
+
// Strict and liberal validator return both INVALID.
INSTANTIATE_TEST_CASE_P(
StrictAndLiberalInvalid,
« no previous file with comments | « no previous file | chromeos/test/data/network/invalid_settings_with_repairs.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698