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 <map> | 6 #include <map> |
7 #include <sstream> | 7 #include <sstream> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 if (indicator_selector.empty()) | 512 if (indicator_selector.empty()) |
513 indicator_selector = "[pref=\"" + (*pref_mapping)->pref() + "\"]"; | 513 indicator_selector = "[pref=\"" + (*pref_mapping)->pref() + "\"]"; |
514 for (ScopedVector<IndicatorTestCase>::const_iterator | 514 for (ScopedVector<IndicatorTestCase>::const_iterator |
515 indicator_test_case = indicator_test_cases.begin(); | 515 indicator_test_case = indicator_test_cases.begin(); |
516 indicator_test_case != indicator_test_cases.end(); | 516 indicator_test_case != indicator_test_cases.end(); |
517 ++indicator_test_case) { | 517 ++indicator_test_case) { |
518 // Check that no controlled setting indicator is visible when no value is | 518 // Check that no controlled setting indicator is visible when no value is |
519 // set by policy. | 519 // set by policy. |
520 PolicyMap policies; | 520 PolicyMap policies; |
521 UpdateProviderPolicy(policies); | 521 UpdateProviderPolicy(policies); |
522 VerifyControlledSettingIndicators(browser(), indicator_selector, | 522 VerifyControlledSettingIndicators( |
523 "", "", false); | 523 browser(), indicator_selector, std::string(), std::string(), false); |
524 // Check that the appropriate controlled setting indicator is shown when a | 524 // Check that the appropriate controlled setting indicator is shown when a |
525 // value is enforced by policy. | 525 // value is enforced by policy. |
526 policies.LoadFrom(&(*indicator_test_case)->policy(), | 526 policies.LoadFrom(&(*indicator_test_case)->policy(), |
527 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); | 527 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER); |
528 UpdateProviderPolicy(policies); | 528 UpdateProviderPolicy(policies); |
529 VerifyControlledSettingIndicators(browser(), indicator_selector, | 529 VerifyControlledSettingIndicators(browser(), indicator_selector, |
530 (*indicator_test_case)->value(), | 530 (*indicator_test_case)->value(), |
531 "policy", | 531 "policy", |
532 (*indicator_test_case)->readonly()); | 532 (*indicator_test_case)->readonly()); |
533 | 533 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 } | 566 } |
567 } | 567 } |
568 | 568 |
569 INSTANTIATE_TEST_CASE_P( | 569 INSTANTIATE_TEST_CASE_P( |
570 PolicyPrefsTestInstance, | 570 PolicyPrefsTestInstance, |
571 PolicyPrefsTest, | 571 PolicyPrefsTest, |
572 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, | 572 testing::ValuesIn(GetChromePolicyDefinitionList()->begin, |
573 GetChromePolicyDefinitionList()->end)); | 573 GetChromePolicyDefinitionList()->end)); |
574 | 574 |
575 } // namespace policy | 575 } // namespace policy |
OLD | NEW |