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

Side by Side Diff: chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator_unittest.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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 "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h" 5 #include "chrome/browser/chromeos/policy/affiliated_cloud_policy_invalidator.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Set up a CloudPolicyCore backed by a simple CloudPolicyStore that does no 77 // Set up a CloudPolicyCore backed by a simple CloudPolicyStore that does no
78 // signature verification and stores policy in memory. 78 // signature verification and stores policy in memory.
79 FakeCloudPolicyStore store; 79 FakeCloudPolicyStore store;
80 CloudPolicyCore core(dm_protocol::kChromeDevicePolicyType, 80 CloudPolicyCore core(dm_protocol::kChromeDevicePolicyType,
81 std::string(), 81 std::string(),
82 &store, 82 &store,
83 base::ThreadTaskRunnerHandle::Get()); 83 base::ThreadTaskRunnerHandle::Get());
84 84
85 // Connect |core|. Expect it to send a registration request. Let the 85 // Connect |core|. Expect it to send a registration request. Let the
86 // registration succeed. 86 // registration succeed.
87 scoped_ptr<MockCloudPolicyClient> policy_client_owner( 87 std::unique_ptr<MockCloudPolicyClient> policy_client_owner(
88 new MockCloudPolicyClient); 88 new MockCloudPolicyClient);
89 MockCloudPolicyClient* policy_client = policy_client_owner.get(); 89 MockCloudPolicyClient* policy_client = policy_client_owner.get();
90 EXPECT_CALL(*policy_client, SetupRegistration("token", "device-id")) 90 EXPECT_CALL(*policy_client, SetupRegistration("token", "device-id"))
91 .WillOnce(WithArgs<1>(Invoke(policy_client, 91 .WillOnce(WithArgs<1>(Invoke(policy_client,
92 &MockCloudPolicyClient::SetDMToken))); 92 &MockCloudPolicyClient::SetDMToken)));
93 core.Connect(std::move(policy_client_owner)); 93 core.Connect(std::move(policy_client_owner));
94 Mock::VerifyAndClearExpectations(&policy_client); 94 Mock::VerifyAndClearExpectations(&policy_client);
95 core.StartRefreshScheduler(); 95 core.StartRefreshScheduler();
96 96
97 DevicePolicyBuilder policy; 97 DevicePolicyBuilder policy;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 EXPECT_EQ(invalidation_version, 188 EXPECT_EQ(invalidation_version,
189 invalidator->highest_handled_invalidation_version()); 189 invalidator->highest_handled_invalidation_version());
190 EXPECT_EQ(&invalidation_service_1, 190 EXPECT_EQ(&invalidation_service_1,
191 invalidator->invalidation_service_for_test()); 191 invalidator->invalidation_service_for_test());
192 192
193 provider.Shutdown(); 193 provider.Shutdown();
194 affiliated_invalidator.OnInvalidationServiceSet(nullptr); 194 affiliated_invalidator.OnInvalidationServiceSet(nullptr);
195 } 195 }
196 196
197 } // namespace policy 197 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698