| 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cstdlib> | 8 #include <cstdlib> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 // Verifies that all known policies have a test case in the JSON file. | 481 // Verifies that all known policies have a test case in the JSON file. |
| 482 // This test fails when a policy is added to | 482 // This test fails when a policy is added to |
| 483 // components/policy/resources/policy_templates.json but a test case is not | 483 // components/policy/resources/policy_templates.json but a test case is not |
| 484 // added to chrome/test/data/policy/policy_test_cases.json. | 484 // added to chrome/test/data/policy/policy_test_cases.json. |
| 485 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); | 485 Schema chrome_schema = Schema::Wrap(GetChromeSchemaData()); |
| 486 ASSERT_TRUE(chrome_schema.valid()); | 486 ASSERT_TRUE(chrome_schema.valid()); |
| 487 | 487 |
| 488 PolicyTestCases policy_test_cases; | 488 PolicyTestCases policy_test_cases; |
| 489 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); | 489 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); |
| 490 !it.IsAtEnd(); it.Advance()) { | 490 !it.IsAtEnd(); it.Advance()) { |
| 491 EXPECT_TRUE(ContainsKey(policy_test_cases.map(), it.key())) | 491 EXPECT_TRUE(base::ContainsKey(policy_test_cases.map(), it.key())) |
| 492 << "Missing policy test case for: " << it.key(); | 492 << "Missing policy test case for: " << it.key(); |
| 493 } | 493 } |
| 494 } | 494 } |
| 495 | 495 |
| 496 // Base class for tests that change policy. | 496 // Base class for tests that change policy. |
| 497 class PolicyPrefsTest : public InProcessBrowserTest { | 497 class PolicyPrefsTest : public InProcessBrowserTest { |
| 498 protected: | 498 protected: |
| 499 void SetUpInProcessBrowserTestFixture() override { | 499 void SetUpInProcessBrowserTestFixture() override { |
| 500 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 500 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 501 .WillRepeatedly(Return(true)); | 501 .WillRepeatedly(Return(true)); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 } | 759 } |
| 760 } | 760 } |
| 761 } | 761 } |
| 762 } | 762 } |
| 763 | 763 |
| 764 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 764 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
| 765 PolicyPrefIndicatorTest, | 765 PolicyPrefIndicatorTest, |
| 766 testing::ValuesIn(SplitPoliciesIntoChunks(10))); | 766 testing::ValuesIn(SplitPoliciesIntoChunks(10))); |
| 767 | 767 |
| 768 } // namespace policy | 768 } // namespace policy |
| OLD | NEW |