Commit 84b1701e authored by James Hawkins's avatar James Hawkins Committed by Commit Bot

Instant Tethering: Remove unused BLE parameters.

R=khorimoto@chromium.org

Bug: none
Test: none
Change-Id: I4056cee71621cb850d86d2a4e42d8c99ef90374d
Reviewed-on: https://chromium-review.googlesource.com/c/1354644Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Commit-Queue: James Hawkins <jhawkins@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612212}
parent 89135304
...@@ -298,8 +298,7 @@ TEST_F(ConnectTetheringOperationTest, DISABLED_TestCannotConnect) { ...@@ -298,8 +298,7 @@ TEST_F(ConnectTetheringOperationTest, DISABLED_TestCannotConnect) {
// Simulate the device failing to connect. // Simulate the device failing to connect.
fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts( fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts(
test_device_.GetDeviceId(), test_device_.GetDeviceId(), 0 /* num_attempts */);
MessageTransferOperation::kMaxEmptyScansPerDevice);
// The maximum number of connection failures has occurred. // The maximum number of connection failures has occurred.
EXPECT_TRUE(test_observer_->has_received_failure()); EXPECT_TRUE(test_observer_->has_received_failure());
......
...@@ -428,8 +428,7 @@ TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) { ...@@ -428,8 +428,7 @@ TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) {
// Simulate device 1 failing to connect. // Simulate device 1 failing to connect.
fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts( fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts(
test_devices_[1].GetDeviceId(), test_devices_[1].GetDeviceId(), 0 /* num_attempts */);
MessageTransferOperation::kMaxEmptyScansPerDevice);
// The scan should still not be over, and no new scan results should have // The scan should still not be over, and no new scan results should have
// come in. // come in.
...@@ -438,8 +437,7 @@ TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) { ...@@ -438,8 +437,7 @@ TEST_F(HostScannerOperationTest, DISABLED_TestMultipleDevices) {
// Simulate device 3 failing to connect. // Simulate device 3 failing to connect.
fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts( fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts(
test_devices_[3].GetDeviceId(), test_devices_[3].GetDeviceId(), 0 /* num_attempts */);
MessageTransferOperation::kMaxEmptyScansPerDevice);
// The scan should still not be over, and no new scan results should have // The scan should still not be over, and no new scan results should have
// come in. // come in.
......
...@@ -155,8 +155,7 @@ TEST_F(KeepAliveOperationTest, ...@@ -155,8 +155,7 @@ TEST_F(KeepAliveOperationTest,
TEST_F(KeepAliveOperationTest, DISABLED_TestCannotConnect) { TEST_F(KeepAliveOperationTest, DISABLED_TestCannotConnect) {
// Simulate the device failing to connect. // Simulate the device failing to connect.
fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts( fake_ble_connection_manager_->SimulateUnansweredConnectionAttempts(
test_device_.GetDeviceId(), test_device_.GetDeviceId(), 0 /* num_attempts */);
MessageTransferOperation::kMaxEmptyScansPerDevice);
// The maximum number of connection failures has occurred. // The maximum number of connection failures has occurred.
EXPECT_TRUE(test_observer_->has_run_callback()); EXPECT_TRUE(test_observer_->has_run_callback());
......
...@@ -36,13 +36,6 @@ cryptauth::RemoteDeviceRefList RemoveDuplicatesFromVector( ...@@ -36,13 +36,6 @@ cryptauth::RemoteDeviceRefList RemoveDuplicatesFromVector(
} // namespace } // namespace
// static
const uint32_t MessageTransferOperation::kMaxEmptyScansPerDevice = 3;
// static
const uint32_t MessageTransferOperation::kMaxGattConnectionAttemptsPerDevice =
6;
MessageTransferOperation::ConnectionAttemptDelegate::ConnectionAttemptDelegate( MessageTransferOperation::ConnectionAttemptDelegate::ConnectionAttemptDelegate(
MessageTransferOperation* operation, MessageTransferOperation* operation,
cryptauth::RemoteDeviceRef remote_device, cryptauth::RemoteDeviceRef remote_device,
......
...@@ -31,21 +31,6 @@ class TimerFactory; ...@@ -31,21 +31,6 @@ class TimerFactory;
// from remote devices. // from remote devices.
class MessageTransferOperation { class MessageTransferOperation {
public: public:
// The number of times to attempt to connect to a device without receiving any
// response before giving up. When a connection to a device is attempted, a
// BLE discovery session listens for advertisements from the remote device as
// the first step of the connection; if no advertisement is picked up, it is
// likely that the remote device is not nearby or is not currently responding
// to Instant Tethering requests.
static const uint32_t kMaxEmptyScansPerDevice;
// The number of times to attempt a GATT connection to a device, after a BLE
// discovery session has already detected a nearby device. GATT connections
// may fail for a variety of reasons, but most failures are ephemeral. Thus,
// more connection attempts are allowed in such cases since it is likely that
// a subsequent attempt will succeed. See https://crbug.com/805218.
static const uint32_t kMaxGattConnectionAttemptsPerDevice;
MessageTransferOperation( MessageTransferOperation(
const cryptauth::RemoteDeviceRefList& devices_to_connect, const cryptauth::RemoteDeviceRefList& devices_to_connect,
secure_channel::ConnectionPriority connection_priority, secure_channel::ConnectionPriority connection_priority,
......
...@@ -175,14 +175,7 @@ class MessageTransferOperationTest : public testing::Test { ...@@ -175,14 +175,7 @@ class MessageTransferOperationTest : public testing::Test {
: test_local_device_(cryptauth::RemoteDeviceRefBuilder() : test_local_device_(cryptauth::RemoteDeviceRefBuilder()
.SetPublicKey("local device") .SetPublicKey("local device")
.Build()), .Build()),
test_devices_(cryptauth::CreateRemoteDeviceRefListForTest(4)) { test_devices_(cryptauth::CreateRemoteDeviceRefListForTest(4)) {}
// These tests are written under the assumption that there are a maximum of
// 3 "empty scan" connection attempts and 6 "GATT" connection attempts; the
// tests need to be edited if these values change.
EXPECT_EQ(3u, MessageTransferOperation::kMaxEmptyScansPerDevice);
EXPECT_EQ(6u,
MessageTransferOperation::kMaxGattConnectionAttemptsPerDevice);
}
void SetUp() override { void SetUp() override {
fake_device_sync_client_ = fake_device_sync_client_ =
......
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