Commit f147ae30 authored by estade@chromium.org's avatar estade@chromium.org

Get rid of more uses of CreateStringValue

split off from https://codereview.chromium.org/388963002/

BUG=160586

Review URL: https://codereview.chromium.org/390183003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@283537 0039d316-1c4b-4281-b951-d872f2087c98
parent c3eb0328
......@@ -242,18 +242,15 @@ void FakeShillDeviceClient::AddDevice(const std::string& device_path,
AddDevice(device_path);
base::DictionaryValue* properties = GetDeviceProperties(device_path);
properties->SetWithoutPathExpansion(shill::kTypeProperty,
base::Value::CreateStringValue(type));
properties->SetWithoutPathExpansion(shill::kNameProperty,
base::Value::CreateStringValue(name));
properties->SetWithoutPathExpansion(
shill::kDBusObjectProperty, base::Value::CreateStringValue(device_path));
properties->SetWithoutPathExpansion(
shill::kDBusServiceProperty,
base::Value::CreateStringValue(modemmanager::kModemManager1ServiceName));
properties->SetStringWithoutPathExpansion(shill::kTypeProperty, type);
properties->SetStringWithoutPathExpansion(shill::kNameProperty, name);
properties->SetStringWithoutPathExpansion(shill::kDBusObjectProperty,
device_path);
properties->SetStringWithoutPathExpansion(
shill::kDBusServiceProperty, modemmanager::kModemManager1ServiceName);
if (type == shill::kTypeCellular) {
properties->SetWithoutPathExpansion(shill::kCellularAllowRoamingProperty,
new base::FundamentalValue(false));
properties->SetBooleanWithoutPathExpansion(
shill::kCellularAllowRoamingProperty, false);
}
}
......
......@@ -361,8 +361,8 @@ ShillManagerClient::TestInterface* FakeShillManagerClient::GetTestInterface() {
// ShillManagerClient::TestInterface overrides.
void FakeShillManagerClient::AddDevice(const std::string& device_path) {
if (GetListProperty(shill::kDevicesProperty)->AppendIfNotPresent(
base::Value::CreateStringValue(device_path))) {
if (GetListProperty(shill::kDevicesProperty)
->AppendIfNotPresent(new base::StringValue(device_path))) {
CallNotifyObserversPropertyChanged(shill::kDevicesProperty);
}
}
......@@ -382,14 +382,14 @@ void FakeShillManagerClient::ClearDevices() {
void FakeShillManagerClient::AddTechnology(const std::string& type,
bool enabled) {
if (GetListProperty(shill::kAvailableTechnologiesProperty)->
AppendIfNotPresent(base::Value::CreateStringValue(type))) {
if (GetListProperty(shill::kAvailableTechnologiesProperty)
->AppendIfNotPresent(new base::StringValue(type))) {
CallNotifyObserversPropertyChanged(
shill::kAvailableTechnologiesProperty);
}
if (enabled &&
GetListProperty(shill::kEnabledTechnologiesProperty)->
AppendIfNotPresent(base::Value::CreateStringValue(type))) {
GetListProperty(shill::kEnabledTechnologiesProperty)
->AppendIfNotPresent(new base::StringValue(type))) {
CallNotifyObserversPropertyChanged(
shill::kEnabledTechnologiesProperty);
}
......@@ -412,8 +412,8 @@ void FakeShillManagerClient::RemoveTechnology(const std::string& type) {
void FakeShillManagerClient::SetTechnologyInitializing(const std::string& type,
bool initializing) {
if (initializing) {
if (GetListProperty(shill::kUninitializedTechnologiesProperty)->
AppendIfNotPresent(base::Value::CreateStringValue(type))) {
if (GetListProperty(shill::kUninitializedTechnologiesProperty)
->AppendIfNotPresent(new base::StringValue(type))) {
CallNotifyObserversPropertyChanged(
shill::kUninitializedTechnologiesProperty);
}
......@@ -460,8 +460,8 @@ void FakeShillManagerClient::AddManagerService(
const std::string& service_path,
bool notify_observers) {
DVLOG(2) << "AddManagerService: " << service_path;
GetListProperty(shill::kServiceCompleteListProperty)->AppendIfNotPresent(
base::Value::CreateStringValue(service_path));
GetListProperty(shill::kServiceCompleteListProperty)
->AppendIfNotPresent(new base::StringValue(service_path));
SortManagerServices(false);
if (notify_observers)
CallNotifyObserversPropertyChanged(shill::kServiceCompleteListProperty);
......
......@@ -267,9 +267,9 @@ TEST_F(GsmSMSClientTest, Get) {
// Create expected result.
base::DictionaryValue expected_result;
expected_result.SetWithoutPathExpansion(
kNumberKey, base::Value::CreateStringValue(kExampleNumber));
expected_result.SetWithoutPathExpansion(
kTextKey, base::Value::CreateStringValue(kExampleText));
kNumberKey, new base::StringValue(kExampleNumber));
expected_result.SetWithoutPathExpansion(kTextKey,
new base::StringValue(kExampleText));
expected_result_ = &expected_result;
// Call Delete.
client_->Get(kServiceName, dbus::ObjectPath(kObjectPath), kIndex,
......@@ -308,10 +308,9 @@ TEST_F(GsmSMSClientTest, List) {
// Create expected result.
base::ListValue expected_result;
base::DictionaryValue* sms = new base::DictionaryValue;
sms->SetWithoutPathExpansion(
kNumberKey, base::Value::CreateStringValue(kExampleNumber));
sms->SetWithoutPathExpansion(
kTextKey, base::Value::CreateStringValue(kExampleText));
sms->SetWithoutPathExpansion(kNumberKey,
new base::StringValue(kExampleNumber));
sms->SetWithoutPathExpansion(kTextKey, new base::StringValue(kExampleText));
expected_result.Append(sms);
expected_result_ = &expected_result;
// Call List.
......
......@@ -38,7 +38,7 @@ base::DictionaryValue* PopStringToStringDictionary(
!entry_reader.PopString(&key) ||
!entry_reader.PopString(&value))
return NULL;
result->SetWithoutPathExpansion(key, base::Value::CreateStringValue(value));
result->SetWithoutPathExpansion(key, new base::StringValue(value));
}
return result.release();
}
......@@ -282,17 +282,14 @@ ShillClientUnittestBase::CreateExampleServiceProperties() {
base::DictionaryValue* properties = new base::DictionaryValue;
properties->SetWithoutPathExpansion(
shill::kGuidProperty,
base::Value::CreateStringValue("00000000-0000-0000-0000-000000000000"));
new base::StringValue("00000000-0000-0000-0000-000000000000"));
properties->SetWithoutPathExpansion(
shill::kModeProperty,
base::Value::CreateStringValue(shill::kModeManaged));
properties->SetWithoutPathExpansion(
shill::kTypeProperty,
base::Value::CreateStringValue(shill::kTypeWifi));
shill::kModeProperty, new base::StringValue(shill::kModeManaged));
properties->SetWithoutPathExpansion(shill::kTypeProperty,
new base::StringValue(shill::kTypeWifi));
shill_property_util::SetSSID("testssid", properties);
properties->SetWithoutPathExpansion(
shill::kSecurityProperty,
base::Value::CreateStringValue(shill::kSecurityPsk));
shill::kSecurityProperty, new base::StringValue(shill::kSecurityPsk));
return properties;
}
......
......@@ -105,7 +105,7 @@ TEST_F(ShillIPConfigClientTest, GetProperties) {
// Create the expected value.
base::DictionaryValue value;
value.SetWithoutPathExpansion(shill::kAddressProperty,
base::Value::CreateStringValue(kAddress));
new base::StringValue(kAddress));
value.SetWithoutPathExpansion(shill::kMtuProperty,
base::Value::CreateIntegerValue(kMtu));
......
......@@ -165,7 +165,7 @@ TEST_F(ShillManagerClientTest, GetNetworksForGeolocation) {
base::DictionaryValue* property_dict_value = new base::DictionaryValue;
property_dict_value->SetWithoutPathExpansion(
shill::kGeoMacAddressProperty,
base::Value::CreateStringValue("01:23:45:67:89:AB"));
new base::StringValue("01:23:45:67:89:AB"));
type_entry_value->Append(property_dict_value);
type_dict_value.SetWithoutPathExpansion("wifi", type_entry_value);
......
......@@ -66,7 +66,7 @@ TEST_F(ShillProfileClientTest, PropertyChanged) {
// Set expectations.
base::ListValue value;
value.Append(base::Value::CreateStringValue(kExampleEntryPath));
value.Append(new base::StringValue(kExampleEntryPath));
MockPropertyChangeObserver observer;
EXPECT_CALL(observer,
OnPropertyChanged(
......@@ -108,7 +108,7 @@ TEST_F(ShillProfileClientTest, GetProperties) {
// Create the expected value.
base::ListValue* entries = new base::ListValue;
entries->Append(base::Value::CreateStringValue(kExampleEntryPath));
entries->Append(new base::StringValue(kExampleEntryPath));
base::DictionaryValue value;
value.SetWithoutPathExpansion(shill::kEntriesProperty, entries);
// Set expectations.
......@@ -142,9 +142,8 @@ TEST_F(ShillProfileClientTest, GetEntry) {
// Create the expected value.
base::DictionaryValue value;
value.SetWithoutPathExpansion(
shill::kTypeProperty,
base::Value::CreateStringValue(shill::kTypeWifi));
value.SetWithoutPathExpansion(shill::kTypeProperty,
new base::StringValue(shill::kTypeWifi));
// Set expectations.
PrepareForMethodCall(shill::kGetEntryFunction,
base::Bind(&ExpectStringArgument, kExampleEntryPath),
......
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