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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 } | 461 } |
462 | 462 |
463 void ClearProviderPolicy() { | 463 void ClearProviderPolicy() { |
464 provider_.UpdateChromePolicy(PolicyMap()); | 464 provider_.UpdateChromePolicy(PolicyMap()); |
465 base::RunLoop().RunUntilIdle(); | 465 base::RunLoop().RunUntilIdle(); |
466 } | 466 } |
467 | 467 |
468 void SetProviderPolicy(const base::DictionaryValue& policies, | 468 void SetProviderPolicy(const base::DictionaryValue& policies, |
469 PolicyLevel level) { | 469 PolicyLevel level) { |
470 PolicyMap policy_map; | 470 PolicyMap policy_map; |
471 for (DictionaryValue::Iterator it(policies); !it.IsAtEnd(); it.Advance()) { | 471 for (base::DictionaryValue::Iterator it(policies); |
| 472 !it.IsAtEnd(); it.Advance()) { |
472 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key()); | 473 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key()); |
473 ASSERT_TRUE(policy_details); | 474 ASSERT_TRUE(policy_details); |
474 policy_map.Set( | 475 policy_map.Set( |
475 it.key(), | 476 it.key(), |
476 level, | 477 level, |
477 POLICY_SCOPE_USER, | 478 POLICY_SCOPE_USER, |
478 it.value().DeepCopy(), | 479 it.value().DeepCopy(), |
479 policy_details->max_external_data_size ? | 480 policy_details->max_external_data_size ? |
480 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(), | 481 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(), |
481 it.key()) : | 482 it.key()) : |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
663 } | 664 } |
664 } | 665 } |
665 } | 666 } |
666 } | 667 } |
667 | 668 |
668 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 669 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
669 PolicyPrefIndicatorTest, | 670 PolicyPrefIndicatorTest, |
670 testing::ValuesIn(SplitPoliciesIntoChunks(50))); | 671 testing::ValuesIn(SplitPoliciesIntoChunks(50))); |
671 | 672 |
672 } // namespace policy | 673 } // namespace policy |
OLD | NEW |