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 |