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

Unified Diff: chrome/browser/ui/webui/settings/people_handler_unittest.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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: chrome/browser/ui/webui/settings/people_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/settings/people_handler_unittest.cc b/chrome/browser/ui/webui/settings/people_handler_unittest.cc
index b6ac3ad5c968c9d75b437fc4651f9f78e20238b9..3182ce3ff37e3821afe8a9544996bd2846220bcd 100644
--- a/chrome/browser/ui/webui/settings/people_handler_unittest.cc
+++ b/chrome/browser/ui/webui/settings/people_handler_unittest.cc
@@ -512,8 +512,8 @@ TEST_F(PeopleHandlerTest, TestSyncEverything) {
std::string args = GetConfiguration(
NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -529,8 +529,8 @@ TEST_F(PeopleHandlerTest, TestPassphraseStillRequired) {
std::string args = GetConfiguration(
NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -551,8 +551,8 @@ TEST_F(PeopleHandlerTest, EnterExistingFrozenImplicitPassword) {
std::string args = GetConfiguration(&dict, SYNC_ALL_DATA, GetAllTypes(),
"oldGaiaPassphrase", ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
// Act as if an encryption passphrase is required the first time, then never
// again after that.
EXPECT_CALL(*mock_pss_, IsPassphraseRequired()).WillOnce(Return(true));
@@ -574,8 +574,8 @@ TEST_F(PeopleHandlerTest, SetNewCustomPassphrase) {
std::string args = GetConfiguration(&dict, SYNC_ALL_DATA, GetAllTypes(),
"custom_passphrase", ENCRYPT_ALL_DATA);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -597,8 +597,8 @@ TEST_F(PeopleHandlerTest, EnterWrongExistingPassphrase) {
std::string args = GetConfiguration(&dict, SYNC_ALL_DATA, GetAllTypes(),
"invalid_passphrase", ENCRYPT_ALL_DATA);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -625,8 +625,8 @@ TEST_F(PeopleHandlerTest, EnterBlankExistingPassphrase) {
"",
ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(true));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -656,8 +656,8 @@ TEST_F(PeopleHandlerTest, TestSyncIndividualTypes) {
std::string(),
ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -679,8 +679,8 @@ TEST_F(PeopleHandlerTest, TestSyncAllManually) {
std::string(),
ENCRYPT_PASSWORDS);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
@@ -893,8 +893,8 @@ TEST_F(PeopleHandlerTest, TurnOnEncryptAllDisallowed) {
std::string args = GetConfiguration(
NULL, SYNC_ALL_DATA, GetAllTypes(), std::string(), ENCRYPT_ALL_DATA);
base::ListValue list_args;
- list_args.Append(new base::StringValue(kTestCallbackId));
- list_args.Append(new base::StringValue(args));
+ list_args.AppendString(kTestCallbackId);
+ list_args.AppendString(args);
EXPECT_CALL(*mock_pss_, IsPassphraseRequiredForDecryption())
.WillRepeatedly(Return(false));
EXPECT_CALL(*mock_pss_, IsPassphraseRequired())
« no previous file with comments | « chrome/browser/ui/webui/settings/font_handler.cc ('k') | chrome/browser/ui/webui/settings/profile_info_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698