| 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 18 matching lines...) Expand all Loading... |
| 29 #include "chrome/browser/ui/browser.h" | 29 #include "chrome/browser/ui/browser.h" |
| 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 30 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 31 #include "chrome/test/base/in_process_browser_test.h" | 31 #include "chrome/test/base/in_process_browser_test.h" |
| 32 #include "chrome/test/base/ui_test_utils.h" | 32 #include "chrome/test/base/ui_test_utils.h" |
| 33 #include "components/policy/core/browser/browser_policy_connector.h" | 33 #include "components/policy/core/browser/browser_policy_connector.h" |
| 34 #include "components/policy/core/common/external_data_fetcher.h" | 34 #include "components/policy/core/common/external_data_fetcher.h" |
| 35 #include "components/policy/core/common/external_data_manager.h" | 35 #include "components/policy/core/common/external_data_manager.h" |
| 36 #include "components/policy/core/common/mock_configuration_policy_provider.h" | 36 #include "components/policy/core/common/mock_configuration_policy_provider.h" |
| 37 #include "components/policy/core/common/policy_details.h" | 37 #include "components/policy/core/common/policy_details.h" |
| 38 #include "components/policy/core/common/policy_map.h" | 38 #include "components/policy/core/common/policy_map.h" |
| 39 #include "components/policy/core/common/policy_types.h" | |
| 40 #include "components/policy/core/common/schema.h" | 39 #include "components/policy/core/common/schema.h" |
| 41 #include "content/public/browser/web_contents.h" | 40 #include "content/public/browser/web_contents.h" |
| 42 #include "content/public/test/browser_test_utils.h" | 41 #include "content/public/test/browser_test_utils.h" |
| 43 #include "policy/policy_constants.h" | 42 #include "policy/policy_constants.h" |
| 44 #include "testing/gmock/include/gmock/gmock.h" | 43 #include "testing/gmock/include/gmock/gmock.h" |
| 45 #include "testing/gtest/include/gtest/gtest.h" | 44 #include "testing/gtest/include/gtest/gtest.h" |
| 46 #include "url/gurl.h" | 45 #include "url/gurl.h" |
| 47 | 46 |
| 48 using testing::Return; | 47 using testing::Return; |
| 49 using testing::_; | 48 using testing::_; |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 513 PolicyLevel level) { | 512 PolicyLevel level) { |
| 514 PolicyMap policy_map; | 513 PolicyMap policy_map; |
| 515 for (base::DictionaryValue::Iterator it(policies); | 514 for (base::DictionaryValue::Iterator it(policies); |
| 516 !it.IsAtEnd(); it.Advance()) { | 515 !it.IsAtEnd(); it.Advance()) { |
| 517 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key()); | 516 const PolicyDetails* policy_details = GetChromePolicyDetails(it.key()); |
| 518 ASSERT_TRUE(policy_details); | 517 ASSERT_TRUE(policy_details); |
| 519 policy_map.Set( | 518 policy_map.Set( |
| 520 it.key(), | 519 it.key(), |
| 521 level, | 520 level, |
| 522 POLICY_SCOPE_USER, | 521 POLICY_SCOPE_USER, |
| 523 POLICY_SOURCE_CLOUD, | |
| 524 it.value().DeepCopy(), | 522 it.value().DeepCopy(), |
| 525 policy_details->max_external_data_size ? | 523 policy_details->max_external_data_size ? |
| 526 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(), | 524 new ExternalDataFetcher(base::WeakPtr<ExternalDataManager>(), |
| 527 it.key()) : | 525 it.key()) : |
| 528 NULL); | 526 NULL); |
| 529 } | 527 } |
| 530 provider_.UpdateChromePolicy(policy_map); | 528 provider_.UpdateChromePolicy(policy_map); |
| 531 base::RunLoop().RunUntilIdle(); | 529 base::RunLoop().RunUntilIdle(); |
| 532 } | 530 } |
| 533 | 531 |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 754 } | 752 } |
| 755 } | 753 } |
| 756 } | 754 } |
| 757 } | 755 } |
| 758 | 756 |
| 759 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, | 757 INSTANTIATE_TEST_CASE_P(PolicyPrefIndicatorTestInstance, |
| 760 PolicyPrefIndicatorTest, | 758 PolicyPrefIndicatorTest, |
| 761 testing::ValuesIn(SplitPoliciesIntoChunks(10))); | 759 testing::ValuesIn(SplitPoliciesIntoChunks(10))); |
| 762 | 760 |
| 763 } // namespace policy | 761 } // namespace policy |
| OLD | NEW |