Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(906)

Unified Diff: webrtc/api/rtcstats_integrationtest.cc

Issue 2583613003: Fix segfault when PeerConnection is destroyed during stats collection. (Closed)
Patch Set: DCHECK in destructor added Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/rtcstatscollector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtcstats_integrationtest.cc
diff --git a/webrtc/api/rtcstats_integrationtest.cc b/webrtc/api/rtcstats_integrationtest.cc
index db54b175188c5dc24715129916efabddbb1debb3..c28130fe8a692558116b401eb2887ef3149454ae 100644
--- a/webrtc/api/rtcstats_integrationtest.cc
+++ b/webrtc/api/rtcstats_integrationtest.cc
@@ -537,6 +537,19 @@ TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
RTCStatsReportVerifier(report.get()).VerifyReport();
}
+TEST_F(RTCStatsIntegrationTest, GetsStatsWhileDestroyingPeerConnections) {
+ StartCall();
+
+ rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
+ RTCStatsObtainer::Create();
+ caller_->pc()->GetStats(stats_obtainer);
+ // This will destroy the peer connection.
+ caller_ = nullptr;
+ // Any pending stats requests should have completed in the act of destroying
+ // the peer connection.
+ EXPECT_TRUE(stats_obtainer->report());
+}
+
} // namespace
} // namespace webrtc
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/rtcstatscollector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698