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 "chrome/browser/chromeos/policy/device_local_account_policy_service.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_service.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 const std::string account_1_user_id_; | 95 const std::string account_1_user_id_; |
96 const std::string account_2_user_id_; | 96 const std::string account_2_user_id_; |
97 | 97 |
98 PolicyMap expected_policy_map_; | 98 PolicyMap expected_policy_map_; |
99 UserPolicyBuilder device_local_account_policy_; | 99 UserPolicyBuilder device_local_account_policy_; |
100 chromeos::CrosSettings cros_settings_; | 100 chromeos::CrosSettings cros_settings_; |
101 scoped_refptr<base::TestSimpleTaskRunner> extension_cache_task_runner_; | 101 scoped_refptr<base::TestSimpleTaskRunner> extension_cache_task_runner_; |
102 MockDeviceManagementService mock_device_management_service_; | 102 MockDeviceManagementService mock_device_management_service_; |
103 FakeAffiliatedInvalidationServiceProvider | 103 FakeAffiliatedInvalidationServiceProvider |
104 affiliated_invalidation_service_provider_; | 104 affiliated_invalidation_service_provider_; |
105 scoped_ptr<DeviceLocalAccountPolicyService> service_; | 105 std::unique_ptr<DeviceLocalAccountPolicyService> service_; |
106 | 106 |
107 private: | 107 private: |
108 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyServiceTestBase); | 108 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyServiceTestBase); |
109 }; | 109 }; |
110 | 110 |
111 class DeviceLocalAccountPolicyServiceTest | 111 class DeviceLocalAccountPolicyServiceTest |
112 : public DeviceLocalAccountPolicyServiceTestBase { | 112 : public DeviceLocalAccountPolicyServiceTestBase { |
113 public: | 113 public: |
114 MOCK_METHOD1(OnRefreshDone, void(bool)); | 114 MOCK_METHOD1(OnRefreshDone, void(bool)); |
115 | 115 |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 class DeviceLocalAccountPolicyExtensionCacheTest | 500 class DeviceLocalAccountPolicyExtensionCacheTest |
501 : public DeviceLocalAccountPolicyServiceTestBase { | 501 : public DeviceLocalAccountPolicyServiceTestBase { |
502 protected: | 502 protected: |
503 DeviceLocalAccountPolicyExtensionCacheTest(); | 503 DeviceLocalAccountPolicyExtensionCacheTest(); |
504 | 504 |
505 void SetUp() override; | 505 void SetUp() override; |
506 | 506 |
507 base::FilePath GetCacheDirectoryForAccountID(const std::string& account_id); | 507 base::FilePath GetCacheDirectoryForAccountID(const std::string& account_id); |
508 | 508 |
509 base::ScopedTempDir cache_root_dir_; | 509 base::ScopedTempDir cache_root_dir_; |
510 scoped_ptr<base::ScopedPathOverride> cache_root_dir_override_; | 510 std::unique_ptr<base::ScopedPathOverride> cache_root_dir_override_; |
511 | 511 |
512 base::FilePath cache_dir_1_; | 512 base::FilePath cache_dir_1_; |
513 base::FilePath cache_dir_2_; | 513 base::FilePath cache_dir_2_; |
514 base::FilePath cache_dir_3_; | 514 base::FilePath cache_dir_3_; |
515 | 515 |
516 private: | 516 private: |
517 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyExtensionCacheTest); | 517 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyExtensionCacheTest); |
518 }; | 518 }; |
519 | 519 |
520 DeviceLocalAccountPolicyExtensionCacheTest:: | 520 DeviceLocalAccountPolicyExtensionCacheTest:: |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 | 778 |
779 class DeviceLocalAccountPolicyProviderTest | 779 class DeviceLocalAccountPolicyProviderTest |
780 : public DeviceLocalAccountPolicyServiceTestBase { | 780 : public DeviceLocalAccountPolicyServiceTestBase { |
781 protected: | 781 protected: |
782 DeviceLocalAccountPolicyProviderTest(); | 782 DeviceLocalAccountPolicyProviderTest(); |
783 | 783 |
784 void SetUp() override; | 784 void SetUp() override; |
785 void TearDown() override; | 785 void TearDown() override; |
786 | 786 |
787 SchemaRegistry schema_registry_; | 787 SchemaRegistry schema_registry_; |
788 scoped_ptr<DeviceLocalAccountPolicyProvider> provider_; | 788 std::unique_ptr<DeviceLocalAccountPolicyProvider> provider_; |
789 MockConfigurationPolicyObserver provider_observer_; | 789 MockConfigurationPolicyObserver provider_observer_; |
790 | 790 |
791 private: | 791 private: |
792 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProviderTest); | 792 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProviderTest); |
793 }; | 793 }; |
794 | 794 |
795 DeviceLocalAccountPolicyProviderTest::DeviceLocalAccountPolicyProviderTest() { | 795 DeviceLocalAccountPolicyProviderTest::DeviceLocalAccountPolicyProviderTest() { |
796 CreatePolicyService(); | 796 CreatePolicyService(); |
797 provider_ = DeviceLocalAccountPolicyProvider::Create( | 797 provider_ = DeviceLocalAccountPolicyProvider::Create( |
798 GenerateDeviceLocalAccountUserId(kAccount1, | 798 GenerateDeviceLocalAccountUserId(kAccount1, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
980 em::DeviceManagementResponse response; | 980 em::DeviceManagementResponse response; |
981 device_local_account_policy_.Build(); | 981 device_local_account_policy_.Build(); |
982 response.mutable_policy_response()->add_response()->CopyFrom( | 982 response.mutable_policy_response()->add_response()->CopyFrom( |
983 device_local_account_policy_.policy()); | 983 device_local_account_policy_.policy()); |
984 request_job->SendResponse(DM_STATUS_SUCCESS, response); | 984 request_job->SendResponse(DM_STATUS_SUCCESS, response); |
985 FlushDeviceSettings(); | 985 FlushDeviceSettings(); |
986 Mock::VerifyAndClearExpectations(&provider_observer_); | 986 Mock::VerifyAndClearExpectations(&provider_observer_); |
987 } | 987 } |
988 | 988 |
989 } // namespace policy | 989 } // namespace policy |
OLD | NEW |