stats: implement transport iceState

https://w3c.github.io/webrtc-stats/#dom-rtctransportstats-selectedcandidatepairid

BUG=webrtc:14022

Change-Id: I206bff7048d2df3e3aff0af55072097f49d54e8f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/261720
Reviewed-by: Henrik Boström <hbos@webrtc.org>
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Philipp Hancke <philipp.hancke@googlemail.com>
Cr-Commit-Position: refs/heads/main@{#36840}
This commit is contained in:
Philipp Hancke
2022-05-09 17:43:31 +02:00
committed by WebRTC LUCI CQ
parent cf4ed1516e
commit 1f49157b41
7 changed files with 61 additions and 3 deletions

View File

@ -2469,6 +2469,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) {
expected_rtp_transport.selected_candidate_pair_changes = 1;
expected_rtp_transport.ice_role = RTCIceRole::kUnknown;
expected_rtp_transport.ice_local_username_fragment = "thelocalufrag";
expected_rtp_transport.ice_state = RTCIceTransportState::kNew;
ASSERT_TRUE(report->Get(expected_rtp_transport.id()));
EXPECT_EQ(
@ -2496,6 +2497,8 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) {
rtcp_transport_channel_stats.ice_transport_stats.packets_received = 4;
rtcp_transport_channel_stats.ice_transport_stats.ice_local_username_fragment =
"thelocalufrag";
rtcp_transport_channel_stats.ice_transport_stats.ice_state =
IceTransportState::kChecking;
pc_->SetTransportStats(kTransportName, {rtp_transport_channel_stats,
rtcp_transport_channel_stats});
@ -2515,6 +2518,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStats) {
expected_rtcp_transport.selected_candidate_pair_changes = 0;
expected_rtcp_transport.ice_role = RTCIceRole::kUnknown;
expected_rtcp_transport.ice_local_username_fragment = "thelocalufrag";
expected_rtcp_transport.ice_state = RTCIceTransportState::kChecking;
expected_rtp_transport.rtcp_transport_stats_id = expected_rtcp_transport.id();
ASSERT_TRUE(report->Get(expected_rtp_transport.id()));
@ -2618,6 +2622,8 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) {
cricket::ICEROLE_CONTROLLING;
rtp_transport_channel_stats.ice_transport_stats.ice_local_username_fragment =
"thelocalufrag";
rtp_transport_channel_stats.ice_transport_stats.ice_state =
IceTransportState::kConnected;
// 0x2F is TLS_RSA_WITH_AES_128_CBC_SHA according to IANA
rtp_transport_channel_stats.ssl_cipher_suite = 0x2F;
rtp_transport_channel_stats.srtp_crypto_suite = rtc::kSrtpAes128CmSha1_80;
@ -2639,6 +2645,7 @@ TEST_F(RTCStatsCollectorTest, CollectRTCTransportStatsWithCrypto) {
expected_rtp_transport.packets_received = 0;
expected_rtp_transport.ice_role = RTCIceRole::kControlling;
expected_rtp_transport.ice_local_username_fragment = "thelocalufrag";
expected_rtp_transport.ice_state = "connected";
// Crypto parameters
expected_rtp_transport.tls_version = "0203";
expected_rtp_transport.dtls_role = RTCDtlsRole::kClient;