Commit 930694e0 authored by dcheng's avatar dcheng Committed by Commit bot

Remove ListValue::Append(new {Fundamental,String}Value(...)) usage in //chrome (part 2)

The raw pointer overload of ListValue::Append() is deprecated and will
be removed. Instead, code should just write:
- ListValue::AppendBoolean()
- ListValue::AppendInteger()
- ListValue::AppendDouble()
- ListValue::AppendString()

This wasn't included in the original CL because the clang tool got
confused when processing this file. It turns out true and false can be
macros!

BUG=581865

Review-Url: https://codereview.chromium.org/2041513002
Cr-Commit-Position: refs/heads/master@{#397858}
parent e5cea98f
......@@ -338,10 +338,10 @@ TEST_F(SigninCreateProfileHandlerTest, CreateProfile) {
// Create a non-supervised profile.
base::ListValue list_args;
list_args.Append(new base::StringValue(kTestProfileName));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(false)); // is_supervised
list_args.AppendString(kTestProfileName);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(false); // is_supervised
handler()->CreateProfile(&list_args);
// Expect a JS callbacks with the new profile information.
......@@ -384,12 +384,12 @@ TEST_F(SigninCreateProfileHandlerTest, CreateSupervisedUser) {
// Create a supervised profile.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername1));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(true)); // is_supervised
list_args.Append(new base::StringValue("")); // supervised_user_id
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername1);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(true); // is_supervised
list_args.AppendString(""); // supervised_user_id
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect a JS callbacks with the new profile information.
......@@ -432,13 +432,13 @@ TEST_F(SigninCreateProfileHandlerTest, ImportSupervisedUser) {
// Import a supervised profile.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername1));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(true)); // is_supervised
list_args.Append(
new base::StringValue(kSupervisedUserId1)); // supervised_user_id
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername1);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(true); // is_supervised
list_args.AppendString(
kSupervisedUserId1); // supervised_user_id
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect a JS callbacks with the new profile information.
......@@ -467,12 +467,12 @@ TEST_F(SigninCreateProfileHandlerTest, ImportSupervisedUserAlreadyOnDevice) {
// Import a supervised profile whose already on the current device.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername2));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false));
list_args.Append(new base::FundamentalValue(true));
list_args.Append(new base::StringValue(kSupervisedUserId2));
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername2);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false);
list_args.AppendBoolean(true);
list_args.AppendString(kSupervisedUserId2);
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect a JS callbacks containing an error message.
......@@ -503,12 +503,12 @@ TEST_F(SigninCreateProfileHandlerTest, CustodianNotAuthenticated) {
// Create a supervised profile.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername1));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(true)); // is_supervised
list_args.Append(new base::StringValue("")); // supervised_user_id
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername1);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(true); // is_supervised
list_args.AppendString(""); // supervised_user_id
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect a JS callbacks containing an error message.
......@@ -538,12 +538,12 @@ TEST_F(SigninCreateProfileHandlerTest, CustodianHasAuthError) {
// Create a supervised profile.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername1));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(true)); // is_supervised
list_args.Append(new base::StringValue("")); // supervised_user_id
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername1);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(true); // is_supervised
list_args.AppendString(""); // supervised_user_id
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect a JS callbacks containing an error message.
......@@ -570,12 +570,12 @@ TEST_F(SigninCreateProfileHandlerTest, NotAllowedToCreateSupervisedUser) {
// Create a supervised profile.
base::ListValue list_args;
list_args.Clear();
list_args.Append(new base::StringValue(kSupervisedUsername1));
list_args.Append(new base::StringValue(profiles::GetDefaultAvatarIconUrl(0)));
list_args.Append(new base::FundamentalValue(false)); // create_shortcut
list_args.Append(new base::FundamentalValue(true)); // is_supervised
list_args.Append(new base::StringValue("")); // supervised_user_id
list_args.Append(new base::StringValue(custodian()->GetPath().value()));
list_args.AppendString(kSupervisedUsername1);
list_args.AppendString(profiles::GetDefaultAvatarIconUrl(0));
list_args.AppendBoolean(false); // create_shortcut
list_args.AppendBoolean(true); // is_supervised
list_args.AppendString(""); // supervised_user_id
list_args.AppendString(custodian()->GetPath().value());
handler()->CreateProfile(&list_args);
// Expect nothing to happen.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment