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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
769 } | 769 } |
770 | 770 |
771 class DeviceLocalAccountPolicyProviderTest | 771 class DeviceLocalAccountPolicyProviderTest |
772 : public DeviceLocalAccountPolicyServiceTestBase { | 772 : public DeviceLocalAccountPolicyServiceTestBase { |
773 protected: | 773 protected: |
774 DeviceLocalAccountPolicyProviderTest(); | 774 DeviceLocalAccountPolicyProviderTest(); |
775 | 775 |
776 virtual void SetUp() OVERRIDE; | 776 virtual void SetUp() OVERRIDE; |
777 virtual void TearDown() OVERRIDE; | 777 virtual void TearDown() OVERRIDE; |
778 | 778 |
779 SchemaRegistry schema_registry_; | |
bartfab (slow)
2013/11/05 15:53:04
Nit: #include "chrome/browser/policy/schema_regist
Joao da Silva
2013/11/07 13:15:00
Done.
| |
779 scoped_ptr<DeviceLocalAccountPolicyProvider> provider_; | 780 scoped_ptr<DeviceLocalAccountPolicyProvider> provider_; |
780 MockConfigurationPolicyObserver provider_observer_; | 781 MockConfigurationPolicyObserver provider_observer_; |
781 | 782 |
782 private: | 783 private: |
783 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProviderTest); | 784 DISALLOW_COPY_AND_ASSIGN(DeviceLocalAccountPolicyProviderTest); |
784 }; | 785 }; |
785 | 786 |
786 DeviceLocalAccountPolicyProviderTest::DeviceLocalAccountPolicyProviderTest() { | 787 DeviceLocalAccountPolicyProviderTest::DeviceLocalAccountPolicyProviderTest() { |
787 CreatePolicyService(); | 788 CreatePolicyService(); |
788 provider_.reset(new DeviceLocalAccountPolicyProvider( | 789 provider_.reset(new DeviceLocalAccountPolicyProvider( |
789 GenerateDeviceLocalAccountUserId(kAccount1, | 790 GenerateDeviceLocalAccountUserId(kAccount1, |
790 DeviceLocalAccount::TYPE_PUBLIC_SESSION), | 791 DeviceLocalAccount::TYPE_PUBLIC_SESSION), |
791 service_.get())); | 792 service_.get())); |
792 } | 793 } |
793 | 794 |
794 void DeviceLocalAccountPolicyProviderTest::SetUp() { | 795 void DeviceLocalAccountPolicyProviderTest::SetUp() { |
795 DeviceLocalAccountPolicyServiceTestBase::SetUp(); | 796 DeviceLocalAccountPolicyServiceTestBase::SetUp(); |
796 provider_->Init(); | 797 provider_->Init(&schema_registry_); |
797 provider_->AddObserver(&provider_observer_); | 798 provider_->AddObserver(&provider_observer_); |
798 } | 799 } |
799 | 800 |
800 void DeviceLocalAccountPolicyProviderTest::TearDown() { | 801 void DeviceLocalAccountPolicyProviderTest::TearDown() { |
801 provider_->RemoveObserver(&provider_observer_); | 802 provider_->RemoveObserver(&provider_observer_); |
802 provider_->Shutdown(); | 803 provider_->Shutdown(); |
803 provider_.reset(); | 804 provider_.reset(); |
804 DeviceLocalAccountPolicyServiceTestBase::TearDown(); | 805 DeviceLocalAccountPolicyServiceTestBase::TearDown(); |
805 } | 806 } |
806 | 807 |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
942 em::DeviceManagementResponse response; | 943 em::DeviceManagementResponse response; |
943 device_local_account_policy_.Build(); | 944 device_local_account_policy_.Build(); |
944 response.mutable_policy_response()->add_response()->CopyFrom( | 945 response.mutable_policy_response()->add_response()->CopyFrom( |
945 device_local_account_policy_.policy()); | 946 device_local_account_policy_.policy()); |
946 request_job->SendResponse(DM_STATUS_SUCCESS, response); | 947 request_job->SendResponse(DM_STATUS_SUCCESS, response); |
947 FlushDeviceSettings(); | 948 FlushDeviceSettings(); |
948 Mock::VerifyAndClearExpectations(&provider_observer_); | 949 Mock::VerifyAndClearExpectations(&provider_observer_); |
949 } | 950 } |
950 | 951 |
951 } // namespace policy | 952 } // namespace policy |
OLD | NEW |