| Index: components/proximity_auth/remote_status_update_unittest.cc
|
| diff --git a/components/proximity_auth/remote_status_update_unittest.cc b/components/proximity_auth/remote_status_update_unittest.cc
|
| index 960ecf60690cc7323433eeea8f5b515a137f7640..ff7af68d392cd32ea498a79ca9dbd14a2c0dad95 100644
|
| --- a/components/proximity_auth/remote_status_update_unittest.cc
|
| +++ b/components/proximity_auth/remote_status_update_unittest.cc
|
| @@ -12,8 +12,8 @@ namespace proximity_auth {
|
| namespace {
|
|
|
| // Parses the |json| into a RemoteStatusUpdate instance.
|
| -scoped_ptr<RemoteStatusUpdate> ParseJson(const std::string& json) {
|
| - scoped_ptr<base::DictionaryValue> as_dictionary =
|
| +std::unique_ptr<RemoteStatusUpdate> ParseJson(const std::string& json) {
|
| + std::unique_ptr<base::DictionaryValue> as_dictionary =
|
| base::DictionaryValue::From(base::JSONReader::Read(json));
|
| return RemoteStatusUpdate::Deserialize(*as_dictionary);
|
| }
|
| @@ -29,7 +29,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_Valid_UserPresent) {
|
| " \"secure_screen_lock\": \"enabled\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| ASSERT_TRUE(parsed_update);
|
| EXPECT_EQ(USER_PRESENT, parsed_update->user_presence);
|
| EXPECT_EQ(SECURE_SCREEN_LOCK_ENABLED,
|
| @@ -45,7 +45,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_Valid_UserAbsent) {
|
| " \"secure_screen_lock\": \"disabled\","
|
| " \"trust_agent\": \"disabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| ASSERT_TRUE(parsed_update);
|
| EXPECT_EQ(USER_ABSENT, parsed_update->user_presence);
|
| EXPECT_EQ(SECURE_SCREEN_LOCK_DISABLED,
|
| @@ -61,7 +61,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_Valid_Unknown) {
|
| " \"secure_screen_lock\": \"unknown\","
|
| " \"trust_agent\": \"unsupported\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kValidJson);
|
| ASSERT_TRUE(parsed_update);
|
| EXPECT_EQ(USER_PRESENCE_UNKNOWN, parsed_update->user_presence);
|
| EXPECT_EQ(SECURE_SCREEN_LOCK_STATE_UNKNOWN,
|
| @@ -76,7 +76,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_MissingUserPresence) {
|
| " \"secure_screen_lock\": \"enabled\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -87,7 +87,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_MissingSecureScreenLock) {
|
| " \"user_presence\": \"present\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -98,7 +98,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_MissingTrustAgent) {
|
| " \"user_presence\": \"present\","
|
| " \"secure_screen_lock\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -110,7 +110,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_InvalidType) {
|
| " \"secure_screen_lock\": \"enabled\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -122,7 +122,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_InvalidPresence) {
|
| " \"secure_screen_lock\": \"enabled\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -134,7 +134,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_InvalidLock) {
|
| " \"secure_screen_lock\": \"garbage\","
|
| " \"trust_agent\": \"enabled\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -146,7 +146,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest, Deserialize_InvalidAgent) {
|
| " \"secure_screen_lock\": \"enabled\","
|
| " \"trust_agent\": \"garbage\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| EXPECT_FALSE(parsed_update);
|
| }
|
|
|
| @@ -162,7 +162,7 @@ TEST(ProximityAuthRemoteStatusUpdateTest,
|
| " \"trust_agent\": \"enabled\","
|
| " \"secret_sauce\": \"chipotle\""
|
| "}";
|
| - scoped_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| + std::unique_ptr<RemoteStatusUpdate> parsed_update = ParseJson(kJson);
|
| ASSERT_TRUE(parsed_update);
|
| EXPECT_EQ(USER_PRESENT, parsed_update->user_presence);
|
| EXPECT_EQ(SECURE_SCREEN_LOCK_ENABLED,
|
|
|