Commit d2748213 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Fix incorrect usage of base::EmptyString().

It is not a general purpose substitute for the default std::string
constructor. Do the same for base::EmptyString16() and base::string16().

Change-Id: I405b94dba0a761ba12bc3e40f712142ba3886d9b
Reviewed-on: https://chromium-review.googlesource.com/c/1295312
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarEvan Stade <estade@chromium.org>
Reviewed-by: default avatarGiovanni Ortuño Urquidi <ortuno@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#602094}
parent 85fb5d03
......@@ -11,7 +11,6 @@
#include "ash/login_status.h"
#include "ash/public/interfaces/session_controller.mojom.h"
#include "ash/session/session_controller.h"
#include "ash/session/session_observer.h"
#include "ash/session/test_session_controller_client.h"
#include "ash/shell.h"
......@@ -610,7 +609,7 @@ class CanSwitchUserTest : public AshTestBase {
Shell::Get()->system_tray_notifier()->NotifyScreenCaptureStart(
base::BindRepeating(&CanSwitchUserTest::StopCaptureCallback,
base::Unretained(this)),
base::EmptyString16());
base::string16());
}
// The callback which gets called when the screen capture gets stopped.
......@@ -627,7 +626,7 @@ class CanSwitchUserTest : public AshTestBase {
Shell::Get()->system_tray_notifier()->NotifyScreenShareStart(
base::BindRepeating(&CanSwitchUserTest::StopShareCallback,
base::Unretained(this)),
base::EmptyString16());
base::string16());
}
// Simulates a screen share session stop.
......
......@@ -716,7 +716,7 @@ std::set<base::string16> AutofillProfileComparator::GetNamePartVariants(
return {name_part};
// Start with the empty string as a variant.
std::set<base::string16> variants = {base::EmptyString16()};
std::set<base::string16> variants = {{}};
// For each sub-name, add a variant of all the already existing variants that
// appends this sub-name and one that appends the initial of this sub-name.
......
......@@ -354,7 +354,7 @@ CreditCard CreateDisusedDeletableTestCreditCard(const std::string& locale) {
class PersonalDatabaseHelper
: public AutofillWebDataServiceObserverOnUISequence {
public:
PersonalDatabaseHelper(PersonalDataManager* personal_data_manager)
explicit PersonalDatabaseHelper(PersonalDataManager* personal_data_manager)
: personal_data_manager_(personal_data_manager) {}
void Init(scoped_refptr<AutofillWebDataService> profile_database,
......@@ -1104,9 +1104,9 @@ void PersonalDataManager::
if (credit_card->billing_address_id() == guid) {
credit_card->set_billing_address_id("");
if (credit_card->record_type() == CreditCard::LOCAL_CARD)
if (credit_card->record_type() == CreditCard::LOCAL_CARD) {
database_helper_->GetLocalDatabase()->UpdateCreditCard(*credit_card);
else {
} else {
DCHECK(database_helper_->GetServerDatabase())
<< "Updating metadata on null server db.";
database_helper_->GetServerDatabase()->UpdateServerCardMetadata(
......@@ -1633,7 +1633,7 @@ void PersonalDataManager::MoveJapanCityToStreetAddress() {
? city
: street_address + line_separator + city;
profile->SetRawInfo(ADDRESS_HOME_STREET_ADDRESS, street_address);
profile->SetRawInfo(ADDRESS_HOME_CITY, base::EmptyString16());
profile->SetRawInfo(ADDRESS_HOME_CITY, base::string16());
// Make the update.
database_helper_->GetLocalDatabase()->UpdateAutofillProfile(*profile);
......
......@@ -116,8 +116,8 @@ TEST_F(BluetoothAllowedDevicesTest, AddTwoDevicesFromTwoOriginsToMap) {
EXPECT_EQ(nullptr, allowed_devices1.GetDeviceId(kDeviceAddress2));
EXPECT_EQ(nullptr, allowed_devices2.GetDeviceId(kDeviceAddress1));
EXPECT_EQ(base::EmptyString(), allowed_devices1.GetDeviceAddress(device_id2));
EXPECT_EQ(base::EmptyString(), allowed_devices2.GetDeviceAddress(device_id1));
EXPECT_EQ(std::string(), allowed_devices1.GetDeviceAddress(device_id2));
EXPECT_EQ(std::string(), allowed_devices2.GetDeviceAddress(device_id1));
// Test that we can retrieve the device address/id.
EXPECT_EQ(device_id1, *(allowed_devices1.GetDeviceId(kDeviceAddress1)));
......@@ -143,8 +143,8 @@ TEST_F(BluetoothAllowedDevicesTest, AddDeviceFromTwoOriginsToMap) {
EXPECT_NE(device_id1, device_id2);
// Test that the wrong origin doesn't have access to the device.
EXPECT_EQ(base::EmptyString(), allowed_devices1.GetDeviceAddress(device_id2));
EXPECT_EQ(base::EmptyString(), allowed_devices2.GetDeviceAddress(device_id1));
EXPECT_EQ(std::string(), allowed_devices1.GetDeviceAddress(device_id2));
EXPECT_EQ(std::string(), allowed_devices2.GetDeviceAddress(device_id1));
}
TEST_F(BluetoothAllowedDevicesTest, AddRemoveAddDevice) {
......@@ -169,7 +169,7 @@ TEST_F(BluetoothAllowedDevicesTest, RemoveDevice) {
allowed_devices.RemoveDevice(kDeviceAddress1);
EXPECT_EQ(nullptr, allowed_devices.GetDeviceId(kDeviceAddress1));
EXPECT_EQ(base::EmptyString(), allowed_devices.GetDeviceAddress(device_id));
EXPECT_EQ(std::string(), allowed_devices.GetDeviceAddress(device_id));
}
TEST_F(BluetoothAllowedDevicesTest, NoPermissionForAnyService) {
......
......@@ -566,7 +566,7 @@ TEST_F(NotificationViewMDTest, TestInlineReply) {
// Nothing should be submitted at this point.
EXPECT_EQ(-1, delegate_->clicked_button_index());
EXPECT_EQ(base::EmptyString16(), delegate_->submitted_reply_string());
EXPECT_EQ(base::string16(), delegate_->submitted_reply_string());
// Click the button again and focus on the inline textfield.
generator.ClickLeftButton();
......
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