Commit 97691abc authored by Himanshu Jaju's avatar Himanshu Jaju Committed by Commit Bot

Rename session_name to client_name.

All usages of session_name have been renamed to client_name in
components/sync_device_info/ for consistency.

Bug: 1014439
Change-Id: Ie620281d81a938d83afbe4ede6dc503c4a0a7b52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1862910
Commit-Queue: Himanshu Jaju <himanshujaju@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705963}
parent d8c6caaa
......@@ -43,7 +43,7 @@ class LocalDeviceInfoProvider {
class MutableLocalDeviceInfoProvider : public LocalDeviceInfoProvider {
public:
virtual void Initialize(const std::string& cache_guid,
const std::string& session_name,
const std::string& client_name,
const base::SysInfo::HardwareInfo& hardware_info) = 0;
virtual void Clear() = 0;
};
......
......@@ -52,7 +52,7 @@ LocalDeviceInfoProviderImpl::RegisterOnInitializedCallback(
void LocalDeviceInfoProviderImpl::Initialize(
const std::string& cache_guid,
const std::string& session_name,
const std::string& client_name,
const base::SysInfo::HardwareInfo& hardware_info) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(!cache_guid.empty());
......@@ -60,7 +60,7 @@ void LocalDeviceInfoProviderImpl::Initialize(
// The local device doesn't have a last updated timestamps. It will be set in
// the specifics when it will be synced up.
local_device_info_ = std::make_unique<DeviceInfo>(
cache_guid, session_name, version_, MakeUserAgentForSync(channel_),
cache_guid, client_name, version_, MakeUserAgentForSync(channel_),
GetLocalDeviceType(), sync_client_->GetSigninScopedDeviceId(),
hardware_info,
/*last_updated_timestamp=*/base::Time(),
......
......@@ -30,7 +30,7 @@ class LocalDeviceInfoProviderImpl : public MutableLocalDeviceInfoProvider {
// MutableLocalDeviceInfoProvider implementation.
void Initialize(const std::string& cache_guid,
const std::string& session_name,
const std::string& client_name,
const base::SysInfo::HardwareInfo& hardware_info) override;
void Clear() override;
version_info::Channel GetChannel() const override;
......
......@@ -15,7 +15,7 @@ namespace syncer {
namespace {
const char kLocalDeviceGuid[] = "foo";
const char kLocalDeviceSessionName[] = "bar";
const char kLocalDeviceClientName[] = "bar";
const char kSharingFCMToken[] = "test_fcm_token";
const char kSharingP256dh[] = "test_p256_dh";
......@@ -58,7 +58,7 @@ class LocalDeviceInfoProviderImplTest : public testing::Test {
void InitializeProvider() { InitializeProvider(kLocalDeviceGuid); }
void InitializeProvider(const std::string& guid) {
provider_->Initialize(guid, kLocalDeviceSessionName,
provider_->Initialize(guid, kLocalDeviceClientName,
base::SysInfo::HardwareInfo());
}
......@@ -74,7 +74,7 @@ TEST_F(LocalDeviceInfoProviderImplTest, GetLocalDeviceInfo) {
const DeviceInfo* local_device_info = provider_->GetLocalDeviceInfo();
ASSERT_NE(nullptr, local_device_info);
EXPECT_EQ(std::string(kLocalDeviceGuid), local_device_info->guid());
EXPECT_EQ(kLocalDeviceSessionName, local_device_info->client_name());
EXPECT_EQ(kLocalDeviceClientName, local_device_info->client_name());
EXPECT_EQ(MakeUserAgentForSync(provider_->GetChannel()),
local_device_info->sync_user_agent());
......
......@@ -20,29 +20,29 @@ namespace {
// Call GetPersonalizableDeviceNameBlocking and make sure its return
// value looks sane.
TEST(GetSessionNameTest, GetPersonalizableDeviceNameBlocking) {
const std::string& session_name = GetPersonalizableDeviceNameBlocking();
EXPECT_FALSE(session_name.empty());
TEST(GetClientNameTest, GetPersonalizableDeviceNameBlocking) {
const std::string& client_name = GetPersonalizableDeviceNameBlocking();
EXPECT_FALSE(client_name.empty());
}
#if defined(OS_CHROMEOS)
// Call GetPersonalizableDeviceNameBlocking on ChromeOS where the
// board type is CHROMEBOOK and make sure the return value is "Chromebook".
TEST(GetSessionNameTest, GetPersonalizableDeviceNameBlockingChromebook) {
TEST(GetClientNameTest, GetPersonalizableDeviceNameBlockingChromebook) {
const char* kLsbRelease = "DEVICETYPE=CHROMEBOOK\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
const std::string& session_name = GetPersonalizableDeviceNameBlocking();
EXPECT_EQ("Chromebook", session_name);
const std::string& client_name = GetPersonalizableDeviceNameBlocking();
EXPECT_EQ("Chromebook", client_name);
}
// Call GetPersonalizableDeviceNameBlocking on ChromeOS where the
// board type is a CHROMEBOX and make sure the return value is "Chromebox".
TEST(GetSessionNameTest, GetPersonalizableDeviceNameBlockingChromebox) {
TEST(GetClientNameTest, GetPersonalizableDeviceNameBlockingChromebox) {
const char* kLsbRelease = "DEVICETYPE=CHROMEBOX\n";
base::SysInfo::SetChromeOSVersionInfoForTest(kLsbRelease, base::Time());
const std::string& session_name = GetPersonalizableDeviceNameBlocking();
EXPECT_EQ("Chromebox", session_name);
const std::string& client_name = GetPersonalizableDeviceNameBlocking();
EXPECT_EQ("Chromebox", client_name);
}
#endif // OS_CHROMEOS
......
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