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

Unified Diff: components/policy/core/common/cloud/cloud_policy_manager_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 side-by-side diff with in-line comments
Download patch
Index: components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
diff --git a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
index f2a15a58c993ec1ceac92980dead25f0d15ce91e..8ce6c09da451b68e2e4601ba720a684d3655eda4 100644
--- a/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
+++ b/components/policy/core/common/cloud/cloud_policy_manager_unittest.cc
@@ -4,10 +4,11 @@
#include "components/policy/core/common/cloud/cloud_policy_manager.h"
+#include <memory>
+
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_client.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
@@ -225,7 +226,7 @@ class CloudPolicyManagerTest : public testing::Test {
SchemaRegistry schema_registry_;
MockConfigurationPolicyObserver observer_;
MockCloudPolicyStore store_;
- scoped_ptr<TestCloudPolicyManager> manager_;
+ std::unique_ptr<TestCloudPolicyManager> manager_;
private:
DISALLOW_COPY_AND_ASSIGN(CloudPolicyManagerTest);
@@ -250,7 +251,7 @@ TEST_F(CloudPolicyManagerTest, InitAndShutdown) {
MockCloudPolicyClient* client = new MockCloudPolicyClient();
EXPECT_CALL(*client, SetupRegistration(_, _));
- manager_->core()->Connect(scoped_ptr<CloudPolicyClient>(client));
+ manager_->core()->Connect(std::unique_ptr<CloudPolicyClient>(client));
Mock::VerifyAndClearExpectations(client);
EXPECT_TRUE(manager_->client());
EXPECT_TRUE(manager_->service());
@@ -271,7 +272,7 @@ TEST_F(CloudPolicyManagerTest, RegistrationAndFetch) {
EXPECT_TRUE(manager_->IsInitializationComplete(POLICY_DOMAIN_CHROME));
MockCloudPolicyClient* client = new MockCloudPolicyClient();
- manager_->core()->Connect(scoped_ptr<CloudPolicyClient>(client));
+ manager_->core()->Connect(std::unique_ptr<CloudPolicyClient>(client));
client->SetDMToken(policy_.policy_data().request_token());
client->NotifyRegistrationStateChanged();
@@ -306,7 +307,7 @@ TEST_F(CloudPolicyManagerTest, Update) {
TEST_F(CloudPolicyManagerTest, RefreshNotRegistered) {
MockCloudPolicyClient* client = new MockCloudPolicyClient();
- manager_->core()->Connect(scoped_ptr<CloudPolicyClient>(client));
+ manager_->core()->Connect(std::unique_ptr<CloudPolicyClient>(client));
EXPECT_CALL(observer_, OnUpdatePolicy(manager_.get()));
store_.NotifyStoreLoaded();
@@ -320,7 +321,7 @@ TEST_F(CloudPolicyManagerTest, RefreshNotRegistered) {
TEST_F(CloudPolicyManagerTest, RefreshSuccessful) {
MockCloudPolicyClient* client = new MockCloudPolicyClient();
- manager_->core()->Connect(scoped_ptr<CloudPolicyClient>(client));
+ manager_->core()->Connect(std::unique_ptr<CloudPolicyClient>(client));
// Simulate a store load.
store_.policy_.reset(new em::PolicyData(policy_.policy_data()));

Powered by Google App Engine
This is Rietveld 408576698