Return false if PeerConnection::GetStats() is called on invalid tracks
Before calling StatsCollctor::GetStats() in PeerConnection::GetStats(), check if the track is valid. If not, return false. A track is invalid if it is not a nullptr and there is no report data for it. BUG=webrtc:6652 Review-Url: https://codereview.webrtc.org/2470023004 Cr-Commit-Position: refs/heads/master@{#14934}
This commit is contained in:
@ -1577,10 +1577,7 @@ TEST_F(PeerConnectionInterfaceTest, GetStatsForVideoTrack) {
|
||||
}
|
||||
|
||||
// Test that we don't get statistics for an invalid track.
|
||||
// TODO(tommi): Fix this test. DoGetStats will return true
|
||||
// for the unknown track (since GetStats is async), but no
|
||||
// data is returned for the track.
|
||||
TEST_F(PeerConnectionInterfaceTest, DISABLED_GetStatsForInvalidTrack) {
|
||||
TEST_F(PeerConnectionInterfaceTest, GetStatsForInvalidTrack) {
|
||||
InitiateCall();
|
||||
rtc::scoped_refptr<AudioTrackInterface> unknown_audio_track(
|
||||
pc_factory_->CreateAudioTrack("unknown track", NULL));
|
||||
|
||||
Reference in New Issue
Block a user