Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: components/policy/core/common/proxy_policy_provider_unittest.cc

Issue 1902633006: Convert //components/policy from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments and use namespace alias Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/callback.h" 5 #include "base/callback.h"
6 #include "base/macros.h" 6 #include "base/macros.h"
7 #include "components/policy/core/common/external_data_fetcher.h" 7 #include "components/policy/core/common/external_data_fetcher.h"
8 #include "components/policy/core/common/mock_configuration_policy_provider.h" 8 #include "components/policy/core/common/mock_configuration_policy_provider.h"
9 #include "components/policy/core/common/policy_types.h" 9 #include "components/policy/core/common/policy_types.h"
10 #include "components/policy/core/common/proxy_policy_provider.h" 10 #include "components/policy/core/common/proxy_policy_provider.h"
(...skipping 17 matching lines...) Expand all
28 proxy_provider_.RemoveObserver(&observer_); 28 proxy_provider_.RemoveObserver(&observer_);
29 proxy_provider_.Shutdown(); 29 proxy_provider_.Shutdown();
30 mock_provider_.Shutdown(); 30 mock_provider_.Shutdown();
31 } 31 }
32 32
33 SchemaRegistry schema_registry_; 33 SchemaRegistry schema_registry_;
34 MockConfigurationPolicyObserver observer_; 34 MockConfigurationPolicyObserver observer_;
35 MockConfigurationPolicyProvider mock_provider_; 35 MockConfigurationPolicyProvider mock_provider_;
36 ProxyPolicyProvider proxy_provider_; 36 ProxyPolicyProvider proxy_provider_;
37 37
38 static scoped_ptr<PolicyBundle> CopyBundle(const PolicyBundle& bundle) { 38 static std::unique_ptr<PolicyBundle> CopyBundle(const PolicyBundle& bundle) {
39 scoped_ptr<PolicyBundle> copy(new PolicyBundle()); 39 std::unique_ptr<PolicyBundle> copy(new PolicyBundle());
40 copy->CopyFrom(bundle); 40 copy->CopyFrom(bundle);
41 return copy; 41 return copy;
42 } 42 }
43 43
44 private: 44 private:
45 DISALLOW_COPY_AND_ASSIGN(ProxyPolicyProviderTest); 45 DISALLOW_COPY_AND_ASSIGN(ProxyPolicyProviderTest);
46 }; 46 };
47 47
48 TEST_F(ProxyPolicyProviderTest, Init) { 48 TEST_F(ProxyPolicyProviderTest, Init) {
49 EXPECT_TRUE(proxy_provider_.IsInitializationComplete(POLICY_DOMAIN_CHROME)); 49 EXPECT_TRUE(proxy_provider_.IsInitializationComplete(POLICY_DOMAIN_CHROME));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 proxy_provider_.SetDelegate(&mock_provider_); 92 proxy_provider_.SetDelegate(&mock_provider_);
93 Mock::VerifyAndClearExpectations(&observer_); 93 Mock::VerifyAndClearExpectations(&observer_);
94 94
95 EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_)).Times(0); 95 EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_)).Times(0);
96 EXPECT_CALL(mock_provider_, RefreshPolicies()); 96 EXPECT_CALL(mock_provider_, RefreshPolicies());
97 proxy_provider_.RefreshPolicies(); 97 proxy_provider_.RefreshPolicies();
98 Mock::VerifyAndClearExpectations(&observer_); 98 Mock::VerifyAndClearExpectations(&observer_);
99 Mock::VerifyAndClearExpectations(&mock_provider_); 99 Mock::VerifyAndClearExpectations(&mock_provider_);
100 100
101 EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_)); 101 EXPECT_CALL(observer_, OnUpdatePolicy(&proxy_provider_));
102 mock_provider_.UpdatePolicy(scoped_ptr<PolicyBundle>(new PolicyBundle())); 102 mock_provider_.UpdatePolicy(
103 std::unique_ptr<PolicyBundle>(new PolicyBundle()));
103 Mock::VerifyAndClearExpectations(&observer_); 104 Mock::VerifyAndClearExpectations(&observer_);
104 } 105 }
105 106
106 } // namespace policy 107 } // namespace policy
OLDNEW
« no previous file with comments | « components/policy/core/common/proxy_policy_provider.cc ('k') | components/policy/core/common/registry_dict_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698