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

Instant Tethering: Add more host connection failure metrics.

Breaks up the UNKNOWN_ERROR enum into 3 enums:
1) UNKNOWN_ERROR, which precisely captures when the host returns an
   UNKNOWN_ERROR response code.
2) NO_RESPONSE, which captures when the client never received a response at
   all. This likely indicates a Bluetooth error.
3) INVALID_HOTSPOT_CREDENTIALS, which captures when the host returns a SUCCESS
   response, but with invalid SSID or password info.

Bug: 785514
Change-Id: I0d40283d8b458dd45a1d490fb53eb075e2eb05e4
Reviewed-on: https://chromium-review.googlesource.com/1011595
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Reviewed-by: default avatarJeremy Klein <jlklein@chromium.org>
Cr-Commit-Position: refs/heads/master@{#550719}
parent 7c723eb6
......@@ -78,9 +78,7 @@ ConnectTetheringOperation::ConnectTetheringOperation(
tether_host_response_recorder_(tether_host_response_recorder),
clock_(base::DefaultClock::GetInstance()),
setup_required_(setup_required),
error_code_to_return_(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR) {}
error_code_to_return_(HostResponseErrorCode::NO_RESPONSE) {}
ConnectTetheringOperation::~ConnectTetheringOperation() = default;
......@@ -140,12 +138,15 @@ void ConnectTetheringOperation::OnMessageReceived(
<< remote_device.GetTruncatedDeviceIdForLogs() << " and "
<< "response_code == SUCCESS, but the response did not "
<< "contain a Wi-Fi SSID and/or password.";
error_code_to_return_ =
HostResponseErrorCode::INVALID_HOTSPOT_CREDENTIALS;
}
} else {
PA_LOG(INFO) << "Received ConnectTetheringResponse from device with ID "
<< remote_device.GetTruncatedDeviceIdForLogs() << " and "
<< "response_code == " << response->response_code() << ".";
error_code_to_return_ = response->response_code();
error_code_to_return_ = ConnectTetheringResponseCodeToHostResponseErrorCode(
response->response_code());
}
// UMA_HISTOGRAM_MEDIUM_TIMES is used because UMA_HISTOGRAM_TIMES has a max
......@@ -198,7 +199,7 @@ void ConnectTetheringOperation::NotifyObserversOfSuccessfulResponse(
}
void ConnectTetheringOperation::NotifyObserversOfConnectionFailure(
ConnectTetheringResponse_ResponseCode error_code) {
HostResponseErrorCode error_code) {
for (auto& observer : observer_list_)
observer.OnConnectTetheringFailure(remote_device_, error_code);
}
......@@ -210,6 +211,38 @@ uint32_t ConnectTetheringOperation::GetTimeoutSeconds() {
kSetupNotRequiredResponseTimeoutSeconds;
}
ConnectTetheringOperation::HostResponseErrorCode
ConnectTetheringOperation::ConnectTetheringResponseCodeToHostResponseErrorCode(
ConnectTetheringResponse_ResponseCode error_code) {
switch (error_code) {
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_PROVISIONING_FAILED:
return HostResponseErrorCode::PROVISIONING_FAILED;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_TIMEOUT:
return HostResponseErrorCode::TETHERING_TIMEOUT;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_UNSUPPORTED:
return HostResponseErrorCode::TETHERING_UNSUPPORTED;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_NO_CELL_DATA:
return HostResponseErrorCode::NO_CELL_DATA;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_FAILED:
return HostResponseErrorCode::ENABLING_HOTSPOT_FAILED;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_TIMEOUT:
return HostResponseErrorCode::ENABLING_HOTSPOT_TIMEOUT;
case ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR:
return HostResponseErrorCode::UNKNOWN_ERROR;
default:
break;
}
return HostResponseErrorCode::NO_RESPONSE;
}
void ConnectTetheringOperation::SetClockForTest(base::Clock* clock_for_test) {
clock_ = clock_for_test;
}
......
......@@ -28,6 +28,20 @@ class TetherHostResponseRecorder;
// notifies observers when the RemoteDevice sends a response.
class ConnectTetheringOperation : public MessageTransferOperation {
public:
// Includes all error codes of ConnectTetheringResponse_ResponseCode, but
// includes extra values, |NO_RESPONSE| and |INVALID_HOTSPOT_CREDENTIALS|.
enum HostResponseErrorCode {
PROVISIONING_FAILED = 0,
TETHERING_TIMEOUT = 1,
TETHERING_UNSUPPORTED = 2,
NO_CELL_DATA = 3,
ENABLING_HOTSPOT_FAILED = 4,
ENABLING_HOTSPOT_TIMEOUT = 5,
UNKNOWN_ERROR = 6,
NO_RESPONSE = 7,
INVALID_HOTSPOT_CREDENTIALS = 8
};
class Factory {
public:
static std::unique_ptr<ConnectTetheringOperation> NewInstance(
......@@ -59,7 +73,7 @@ class ConnectTetheringOperation : public MessageTransferOperation {
const std::string& password) = 0;
virtual void OnConnectTetheringFailure(
const cryptauth::RemoteDevice& remote_device,
ConnectTetheringResponse_ResponseCode error_code) = 0;
HostResponseErrorCode error_code) = 0;
};
~ConnectTetheringOperation() override;
......@@ -87,14 +101,16 @@ class ConnectTetheringOperation : public MessageTransferOperation {
void NotifyConnectTetheringRequestSent();
void NotifyObserversOfSuccessfulResponse(const std::string& ssid,
const std::string& password);
void NotifyObserversOfConnectionFailure(
ConnectTetheringResponse_ResponseCode error_code);
void NotifyObserversOfConnectionFailure(HostResponseErrorCode error_code);
private:
friend class ConnectTetheringOperationTest;
FRIEND_TEST_ALL_PREFIXES(ConnectTetheringOperationTest,
TestOperation_SetupRequired);
HostResponseErrorCode ConnectTetheringResponseCodeToHostResponseErrorCode(
ConnectTetheringResponse_ResponseCode error_code);
void SetClockForTest(base::Clock* clock_for_test);
// The amount of time this operation will wait for a response. The timeout
......@@ -112,7 +128,7 @@ class ConnectTetheringOperation : public MessageTransferOperation {
// OnOperationFinished().
std::string ssid_to_return_;
std::string password_to_return_;
ConnectTetheringResponse_ResponseCode error_code_to_return_;
HostResponseErrorCode error_code_to_return_;
base::Time connect_tethering_request_start_time_;
base::ObserverList<Observer> observer_list_;
......
......@@ -46,7 +46,9 @@ class TestObserver final : public ConnectTetheringOperation::Observer {
const std::string& password() { return password_; }
bool has_received_failure() { return has_received_failure_; }
bool has_sent_request() { return has_sent_request_; }
ConnectTetheringResponse_ResponseCode error_code() { return error_code_; }
ConnectTetheringOperation::HostResponseErrorCode error_code() {
return error_code_;
}
// ConnectTetheringOperation::Observer:
void OnConnectTetheringRequestSent(
......@@ -65,7 +67,7 @@ class TestObserver final : public ConnectTetheringOperation::Observer {
void OnConnectTetheringFailure(
const cryptauth::RemoteDevice& remote_device,
ConnectTetheringResponse_ResponseCode error_code) override {
ConnectTetheringOperation::HostResponseErrorCode error_code) override {
has_received_failure_ = true;
remote_device_ = remote_device;
error_code_ = error_code;
......@@ -77,7 +79,7 @@ class TestObserver final : public ConnectTetheringOperation::Observer {
std::string password_;
bool has_received_failure_ = false;
bool has_sent_request_ = false;
ConnectTetheringResponse_ResponseCode error_code_;
ConnectTetheringOperation::HostResponseErrorCode error_code_;
};
std::string CreateConnectTetheringRequestString() {
......@@ -154,6 +156,7 @@ class ConnectTetheringOperationTest : public testing::Test {
void SimulateResponseReceivedAndVerifyObserverCallbackInvoked(
ConnectTetheringResponse_ResponseCode response_code,
ConnectTetheringOperation::HostResponseErrorCode expected_error_code,
bool use_proto_without_ssid_and_password) {
test_clock_.Advance(kConnectTetheringResponseTime);
......@@ -184,7 +187,7 @@ class ConnectTetheringOperationTest : public testing::Test {
EXPECT_EQ(std::string(kTestPassword), test_observer_->password());
} else {
EXPECT_TRUE(test_observer_->has_received_failure());
EXPECT_EQ(expected_response_code, test_observer_->error_code());
EXPECT_EQ(expected_error_code, test_observer_->error_code());
}
histogram_tester_.ExpectTimeBucketCount(
......@@ -228,6 +231,8 @@ TEST_F(ConnectTetheringOperationTest, TestOperation_SuccessButInvalidResponse) {
SimulateResponseReceivedAndVerifyObserverCallbackInvoked(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_SUCCESS,
ConnectTetheringOperation::HostResponseErrorCode::
INVALID_HOTSPOT_CREDENTIALS,
true /* use_proto_without_ssid_and_password */);
}
......@@ -239,6 +244,7 @@ TEST_F(ConnectTetheringOperationTest, TestOperation_SuccessWithValidResponse) {
SimulateResponseReceivedAndVerifyObserverCallbackInvoked(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_SUCCESS,
ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR,
false /* use_proto_without_ssid_and_password */);
}
......@@ -251,6 +257,7 @@ TEST_F(ConnectTetheringOperationTest, TestOperation_UnknownError) {
SimulateResponseReceivedAndVerifyObserverCallbackInvoked(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR,
ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR,
false /* use_proto_without_ssid_and_password */);
}
......@@ -263,6 +270,7 @@ TEST_F(ConnectTetheringOperationTest, TestOperation_ProvisioningFailed) {
SimulateResponseReceivedAndVerifyObserverCallbackInvoked(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_PROVISIONING_FAILED,
ConnectTetheringOperation::HostResponseErrorCode::PROVISIONING_FAILED,
false /* use_proto_without_ssid_and_password */);
}
......@@ -278,8 +286,7 @@ TEST_F(ConnectTetheringOperationTest, TestCannotConnect) {
// The maximum number of connection failures has occurred.
EXPECT_TRUE(test_observer_->has_received_failure());
EXPECT_EQ(ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR,
EXPECT_EQ(ConnectTetheringOperation::HostResponseErrorCode::NO_RESPONSE,
test_observer_->error_code());
histogram_tester_.ExpectTotalCount(
......
......@@ -95,6 +95,15 @@ void HostConnectionMetricsLogger::RecordConnectionToHostResult(
RecordConnectionResultFailure(
ConnectionToHostResult_FailureEventType::ENABLING_HOTSPOT_TIMEOUT);
break;
case ConnectionToHostResult::CONNECTION_RESULT_FAILURE_NO_RESPONSE:
RecordConnectionResultFailure(
ConnectionToHostResult_FailureEventType::NO_RESPONSE);
break;
case ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS:
RecordConnectionResultFailure(
ConnectionToHostResult_FailureEventType::INVALID_HOTSPOT_CREDENTIALS);
break;
default:
NOTREACHED();
};
......
......@@ -40,7 +40,9 @@ class HostConnectionMetricsLogger
CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED,
CONNECTION_RESULT_FAILURE_NO_CELL_DATA,
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED,
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT,
CONNECTION_RESULT_FAILURE_NO_RESPONSE,
CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS
};
// Record the result of an attempted host connection.
......@@ -105,6 +107,11 @@ class HostConnectionMetricsLogger
RecordConnectToHostDuration);
FRIEND_TEST_ALL_PREFIXES(HostConnectionMetricsLoggerTest,
RecordConnectToHostDuration_Background);
FRIEND_TEST_ALL_PREFIXES(HostConnectionMetricsLoggerTest,
RecordConnectionResultFailureNoResponse);
FRIEND_TEST_ALL_PREFIXES(
HostConnectionMetricsLoggerTest,
RecordConnectionResultFailureInvalidHotspotCredentials);
// An Instant Tethering connection can fail for several different reasons.
// Though traditionally success and each failure case would be logged to a
......@@ -140,6 +147,8 @@ class HostConnectionMetricsLogger
NO_CELL_DATA = 4,
ENABLING_HOTSPOT_FAILED = 5,
ENABLING_HOTSPOT_TIMEOUT = 6,
NO_RESPONSE = 7,
INVALID_HOTSPOT_CREDENTIALS = 8,
FAILURE_MAX
};
......
......@@ -464,6 +464,41 @@ TEST_F(HostConnectionMetricsLoggerTest,
VerifyConnectToHostDuration(true /* is_background_advertisement */);
}
TEST_F(HostConnectionMetricsLoggerTest,
RecordConnectionResultFailureNoResponse) {
SetActiveHostToConnectingAndReceiveAdvertisement(
test_devices_[0].GetDeviceId(), false /* is_background_advertisement */);
metrics_logger_->RecordConnectionToHostResult(
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_NO_RESPONSE,
test_devices_[0].GetDeviceId());
VerifyFailure(HostConnectionMetricsLogger::
ConnectionToHostResult_FailureEventType::NO_RESPONSE);
VerifySuccess(HostConnectionMetricsLogger::
ConnectionToHostResult_SuccessEventType::FAILURE,
false /* is_background_advertisement */);
}
TEST_F(HostConnectionMetricsLoggerTest,
RecordConnectionResultFailureInvalidHotspotCredentials) {
SetActiveHostToConnectingAndReceiveAdvertisement(
test_devices_[0].GetDeviceId(), false /* is_background_advertisement */);
metrics_logger_->RecordConnectionToHostResult(
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS,
test_devices_[0].GetDeviceId());
VerifyFailure(
HostConnectionMetricsLogger::ConnectionToHostResult_FailureEventType::
INVALID_HOTSPOT_CREDENTIALS);
VerifySuccess(HostConnectionMetricsLogger::
ConnectionToHostResult_SuccessEventType::FAILURE,
false /* is_background_advertisement */);
}
} // namespace tether
} // namespace chromeos
......@@ -202,7 +202,7 @@ void TetherConnectorImpl::OnSuccessfulConnectTetheringResponse(
void TetherConnectorImpl::OnConnectTetheringFailure(
const cryptauth::RemoteDevice& remote_device,
ConnectTetheringResponse_ResponseCode error_code) {
ConnectTetheringOperation::HostResponseErrorCode error_code) {
std::string device_id_copy = remote_device.GetDeviceId();
if (device_id_pending_connection_ != device_id_copy) {
// If the failure was part of a previous attempt for a different device,
......@@ -366,17 +366,15 @@ void TetherConnectorImpl::OnWifiConnection(
HostConnectionMetricsLogger::ConnectionToHostResult
TetherConnectorImpl::GetConnectionToHostResultFromErrorCode(
const std::string& device_id,
ConnectTetheringResponse_ResponseCode error_code) {
ConnectTetheringOperation::HostResponseErrorCode error_code) {
if (error_code ==
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_PROVISIONING_FAILED) {
ConnectTetheringOperation::HostResponseErrorCode::PROVISIONING_FAILED) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_PROVISIONING_FAILED;
}
if (error_code ==
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_TIMEOUT) {
ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT) {
const std::string tether_network_guid =
device_id_tether_network_guid_map_->GetTetherNetworkGuidForDeviceId(
device_id);
......@@ -390,34 +388,43 @@ TetherConnectorImpl::GetConnectionToHostResultFromErrorCode(
}
if (error_code ==
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_UNSUPPORTED) {
ConnectTetheringOperation::HostResponseErrorCode::TETHERING_UNSUPPORTED) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED;
}
if (error_code == ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_NO_CELL_DATA) {
if (error_code ==
ConnectTetheringOperation::HostResponseErrorCode::NO_CELL_DATA) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_NO_CELL_DATA;
}
if (error_code ==
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_FAILED) {
if (error_code == ConnectTetheringOperation::HostResponseErrorCode::
ENABLING_HOTSPOT_FAILED) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED;
}
if (error_code ==
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_TIMEOUT) {
if (error_code == ConnectTetheringOperation::HostResponseErrorCode::
ENABLING_HOTSPOT_TIMEOUT) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT;
}
if (error_code ==
ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR;
}
if (error_code == ConnectTetheringOperation::HostResponseErrorCode::
INVALID_HOTSPOT_CREDENTIALS) {
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS;
}
return HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR;
CONNECTION_RESULT_FAILURE_NO_RESPONSE;
}
} // namespace tether
......
......@@ -69,7 +69,7 @@ class TetherConnectorImpl : public TetherConnector,
const std::string& password) override;
void OnConnectTetheringFailure(
const cryptauth::RemoteDevice& remote_device,
ConnectTetheringResponse_ResponseCode error_code) override;
ConnectTetheringOperation::HostResponseErrorCode error_code) override;
private:
friend class TetherConnectorImplTest;
......@@ -88,7 +88,7 @@ class TetherConnectorImpl : public TetherConnector,
HostConnectionMetricsLogger::ConnectionToHostResult
GetConnectionToHostResultFromErrorCode(
const std::string& device_id,
ConnectTetheringResponse_ResponseCode error_code);
ConnectTetheringOperation::HostResponseErrorCode error_code);
NetworkConnectionHandler* network_connection_handler_;
NetworkStateHandler* network_state_handler_;
......
......@@ -82,7 +82,8 @@ class FakeConnectTetheringOperation : public ConnectTetheringOperation {
NotifyObserversOfSuccessfulResponse(ssid, password);
}
void SendFailedResponse(ConnectTetheringResponse_ResponseCode error_code) {
void SendFailedResponse(
ConnectTetheringOperation::HostResponseErrorCode error_code) {
NotifyObserversOfConnectionFailure(error_code);
}
......@@ -254,7 +255,7 @@ class TetherConnectorImplTest : public NetworkStateTest {
}
void VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode response_code,
ConnectTetheringOperation::HostResponseErrorCode response_code,
bool setup_required,
HostConnectionMetricsLogger::ConnectionToHostResult expected_event_type) {
EXPECT_CALL(*mock_host_connection_metrics_logger_,
......@@ -400,8 +401,7 @@ TEST_F(TetherConnectorImplTest, TestCancelWhileOperationActive) {
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_SetupNotRequired) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR,
ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR);
......@@ -410,8 +410,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_SetupRequired) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_UNKNOWN_ERROR,
ConnectTetheringOperation::HostResponseErrorCode::UNKNOWN_ERROR,
true /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_UNKNOWN_ERROR);
......@@ -420,8 +419,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_ProvisioningFailed) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_PROVISIONING_FAILED,
ConnectTetheringOperation::HostResponseErrorCode::PROVISIONING_FAILED,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_PROVISIONING_FAILED);
......@@ -430,8 +428,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_TetheringTimeout_SetupNotRequired) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_TIMEOUT,
ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_NOT_REQUIRED);
......@@ -440,8 +437,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_TetheringTimeout_SetupRequired) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_TIMEOUT,
ConnectTetheringOperation::HostResponseErrorCode::TETHERING_TIMEOUT,
true /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_TETHERING_TIMED_OUT_FIRST_TIME_SETUP_WAS_REQUIRED);
......@@ -450,8 +446,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_TetheringUnsupported) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_TETHERING_UNSUPPORTED,
ConnectTetheringOperation::HostResponseErrorCode::TETHERING_UNSUPPORTED,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_TETHERING_UNSUPPORTED);
......@@ -459,8 +454,7 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest, TestConnectTetheringOperationFails_NoCellData) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_NO_CELL_DATA,
ConnectTetheringOperation::HostResponseErrorCode::NO_CELL_DATA,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_NO_CELL_DATA);
......@@ -469,8 +463,7 @@ TEST_F(TetherConnectorImplTest, TestConnectTetheringOperationFails_NoCellData) {
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_EnableHotspotFailed) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_FAILED,
ConnectTetheringOperation::HostResponseErrorCode::ENABLING_HOTSPOT_FAILED,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_FAILED);
......@@ -479,13 +472,31 @@ TEST_F(TetherConnectorImplTest,
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_EnableHotspotTimeout) {
VerifyConnectTetheringOperationFails(
ConnectTetheringResponse_ResponseCode::
ConnectTetheringResponse_ResponseCode_ENABLING_HOTSPOT_TIMEOUT,
ConnectTetheringOperation::HostResponseErrorCode::
ENABLING_HOTSPOT_TIMEOUT,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_ENABLING_HOTSPOT_TIMEOUT);
}
TEST_F(TetherConnectorImplTest, TestConnectTetheringOperationFails_NoResponse) {
VerifyConnectTetheringOperationFails(
ConnectTetheringOperation::HostResponseErrorCode::NO_RESPONSE,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_NO_RESPONSE);
}
TEST_F(TetherConnectorImplTest,
TestConnectTetheringOperationFails_InvalidHotspotCredentials) {
VerifyConnectTetheringOperationFails(
ConnectTetheringOperation::HostResponseErrorCode::
INVALID_HOTSPOT_CREDENTIALS,
false /* setup_required */,
HostConnectionMetricsLogger::ConnectionToHostResult::
CONNECTION_RESULT_FAILURE_INVALID_HOTSPOT_CREDENTIALS);
}
TEST_F(TetherConnectorImplTest,
ConnectionToHostFailedNotificationRemovedWhenConnectionStarts) {
// Start with the "connection to host failed" notification showing.
......
......@@ -23869,6 +23869,8 @@ Called by update_gpu_driver_bug_workaround_entries.py.-->
<int value="4" label="No cellular data"/>
<int value="5" label="Enabling hotspot failed"/>
<int value="6" label="Enabling hotspot timed out"/>
<int value="7" label="No response"/>
<int value="8" label="Invalid hotspot credentials"/>
</enum>
<enum name="InstantTethering_ConnectionToHostResult_Failure_ClientConnection">
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