| 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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); | 483 for (Schema::Iterator it = chrome_schema.GetPropertiesIterator(); |
| 484 !it.IsAtEnd(); it.Advance()) { | 484 !it.IsAtEnd(); it.Advance()) { |
| 485 EXPECT_TRUE(ContainsKey(policy_test_cases.map(), it.key())) | 485 EXPECT_TRUE(ContainsKey(policy_test_cases.map(), it.key())) |
| 486 << "Missing policy test case for: " << it.key(); | 486 << "Missing policy test case for: " << it.key(); |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 | 489 |
| 490 // Base class for tests that change policy. | 490 // Base class for tests that change policy. |
| 491 class PolicyPrefsTest : public InProcessBrowserTest { | 491 class PolicyPrefsTest : public InProcessBrowserTest { |
| 492 protected: | 492 protected: |
| 493 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | 493 virtual void SetUpInProcessBrowserTestFixture() override { |
| 494 EXPECT_CALL(provider_, IsInitializationComplete(_)) | 494 EXPECT_CALL(provider_, IsInitializationComplete(_)) |
| 495 .WillRepeatedly(Return(true)); | 495 .WillRepeatedly(Return(true)); |
| 496 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); | 496 BrowserPolicyConnector::SetPolicyProviderForTesting(&provider_); |
| 497 } | 497 } |
| 498 | 498 |
| 499 virtual void SetUpOnMainThread() OVERRIDE { | 499 virtual void SetUpOnMainThread() override { |
| 500 ui_test_utils::WaitForTemplateURLServiceToLoad( | 500 ui_test_utils::WaitForTemplateURLServiceToLoad( |
| 501 TemplateURLServiceFactory::GetForProfile(browser()->profile())); | 501 TemplateURLServiceFactory::GetForProfile(browser()->profile())); |
| 502 } | 502 } |
| 503 | 503 |
| 504 virtual void TearDownOnMainThread() OVERRIDE { | 504 virtual void TearDownOnMainThread() override { |
| 505 ClearProviderPolicy(); | 505 ClearProviderPolicy(); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void ClearProviderPolicy() { | 508 void ClearProviderPolicy() { |
| 509 provider_.UpdateChromePolicy(PolicyMap()); | 509 provider_.UpdateChromePolicy(PolicyMap()); |
| 510 base::RunLoop().RunUntilIdle(); | 510 base::RunLoop().RunUntilIdle(); |
| 511 } | 511 } |
| 512 | 512 |
| 513 void SetProviderPolicy(const base::DictionaryValue& policies, | 513 void SetProviderPolicy(const base::DictionaryValue& policies, |
| 514 PolicyLevel level) { | 514 PolicyLevel level) { |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 } | 744 } |
| 745 } | 745 } |
| 746 } | 746 } |
| 747 } | 747 } |
| 748 | 748 |
| 749 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 749 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
| 750 PolicyPrefIndicatorTest, | 750 PolicyPrefIndicatorTest, |
| 751 testing::ValuesIn(SplitPoliciesIntoChunks(10))); | 751 testing::ValuesIn(SplitPoliciesIntoChunks(10))); |
| 752 | 752 |
| 753 } // namespace policy | 753 } // namespace policy |
| OLD | NEW |