OLD | NEW |
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 <algorithm> | 5 #include <algorithm> |
6 #include <cstdlib> | 6 #include <cstdlib> |
7 #include <map> | 7 #include <map> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
426 << "Expected to find at least one visible controlled setting " | 426 << "Expected to find at least one visible controlled setting " |
427 << "indicator."; | 427 << "indicator."; |
428 } | 428 } |
429 } | 429 } |
430 | 430 |
431 } // namespace | 431 } // namespace |
432 | 432 |
433 TEST(PolicyPrefsTestCoverageTest, AllPoliciesHaveATestCase) { | 433 TEST(PolicyPrefsTestCoverageTest, AllPoliciesHaveATestCase) { |
434 // Verifies that all known policies have a test case in the JSON file. | 434 // Verifies that all known policies have a test case in the JSON file. |
435 // This test fails when a policy is added to | 435 // This test fails when a policy is added to |
436 // chrome/app/policy/policy_templates.json but a test case is not added to | 436 // components/policy/resources/policy_templates.json but a test case is not |
437 // chrome/test/data/policy/policy_test_cases.json. | 437 // added to chrome/test/data/policy/policy_test_cases.json. |
438 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); | 438 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); |
439 ASSERT_TRUE(chrome_schema.valid()); | 439 ASSERT_TRUE(chrome_schema.valid()); |
440 | 440 |
441 PolicyTestCases policy_test_cases; | 441 PolicyTestCases policy_test_cases; |
442 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); | 442 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); |
443 !it.IsAtEnd(); it.Advance()) { | 443 !it.IsAtEnd(); it.Advance()) { |
444 EXPECT_TRUE(ContainsKey(policy_test_cases.map(), it.key())) | 444 EXPECT_TRUE(ContainsKey(policy_test_cases.map(), it.key())) |
445 << "Missing policy test case for: " << it.key(); | 445 << "Missing policy test case for: " << it.key(); |
446 } | 446 } |
447 } | 447 } |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 663 } |
664 } | 664 } |
665 } | 665 } |
666 } | 666 } |
667 | 667 |
668 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 668 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
669 PolicyPrefIndicatorTest, | 669 PolicyPrefIndicatorTest, |
670 testing::ValuesIn(SplitPoliciesIntoChunks(50))); | 670 testing::ValuesIn(SplitPoliciesIntoChunks(50))); |
671 | 671 |
672 } // namespace policy | 672 } // namespace policy |
OLD | NEW |