Index: webrtc/api/rtcstats_integrationtest.cc |
diff --git a/webrtc/api/rtcstats_integrationtest.cc b/webrtc/api/rtcstats_integrationtest.cc |
index db54b175188c5dc24715129916efabddbb1debb3..0308d57ddad9cb468eb4810933b62b82726caabe 100644 |
--- a/webrtc/api/rtcstats_integrationtest.cc |
+++ b/webrtc/api/rtcstats_integrationtest.cc |
@@ -73,6 +73,10 @@ class RTCStatsIntegrationTest : public testing::Test { |
callee_->WaitForCallEstablished(); |
} |
+ void DestroyCallerAndCallee() { |
+ caller_ = callee_ = nullptr; |
+ } |
+ |
rtc::scoped_refptr<const RTCStatsReport> GetStatsFromCaller() { |
return GetStats(caller_->pc()); |
} |
@@ -537,6 +541,18 @@ 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); |
+ DestroyCallerAndCallee(); |
hta-webrtc
2016/12/16 14:05:31
In the interest of minimizing the amount of side e
hbos
2016/12/16 14:34:52
Good point, changed to "caller_ = nullptr" and rem
|
+ // Any pending stats requests should have completed in the act of destroying |
+ // the peer connection. |
+ EXPECT_TRUE(stats_obtainer->report()); |
+} |
+ |
} // namespace |
} // namespace webrtc |