Commit d2f25193 authored by Ryan Hansberry's avatar Ryan Hansberry Committed by Commit Bot

[CrOS Multidevice] tether::MessageTransferOperation: use the correct Tether feature constant.

This is the correct constant that is expected by host devices.

Bug: 824568, 752273
Change-Id: I7f29159de6eb66f92f4534cd558fe82027175914
Reviewed-on: https://chromium-review.googlesource.com/1105621Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568713}
parent ac6e2f9a
......@@ -18,6 +18,8 @@ namespace tether {
namespace {
const char kTetherFeature[] = "magic_tether";
cryptauth::RemoteDeviceRefList RemoveDuplicatesFromVector(
const cryptauth::RemoteDeviceRefList& remote_devices) {
cryptauth::RemoteDeviceRefList updated_remote_devices;
......@@ -148,7 +150,7 @@ void MessageTransferOperation::Initialize() {
this, remote_device,
secure_channel_client_->ListenForConnectionFromDevice(
remote_device, *device_sync_client_->GetLocalDeviceMetadata(),
"tether", connection_priority_));
kTetherFeature, connection_priority_));
} else {
connection_manager_->RegisterRemoteDevice(
remote_device.GetDeviceId(), request_id_, connection_priority_);
......
......@@ -34,6 +34,8 @@ const MessageType kTestMessageType = MessageType::TETHER_AVAILABILITY_REQUEST;
const uint32_t kTestTimeoutSeconds = 5;
const char kTetherFeature[] = "magic_tether";
// A test double for MessageTransferOperation is needed because
// MessageTransferOperation has pure virtual methods which must be overridden in
// order to create a concrete instantiation of the class.
......@@ -224,6 +226,15 @@ class MessageTransferOperationTest : public testing::Test {
VerifyOperationStartedAndFinished(false /* has_started */,
false /* has_finished */);
operation_->Initialize();
if (base::FeatureList::IsEnabled(chromeos::features::kMultiDeviceApi)) {
for (const auto* arguments :
fake_secure_channel_client_
->last_listen_for_connection_request_arguments_list()) {
EXPECT_EQ(kTetherFeature, arguments->feature);
}
}
VerifyOperationStartedAndFinished(true /* has_started */,
false /* has_finished */);
}
......
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