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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « webrtc/api/peerconnection.cc ('k') | webrtc/api/rtcstatscollector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 RTCStatsReportVerifier(report.get()).VerifyReport(); 530 RTCStatsReportVerifier(report.get()).VerifyReport();
531 } 531 }
532 532
533 TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) { 533 TEST_F(RTCStatsIntegrationTest, GetStatsFromCallee) {
534 StartCall(); 534 StartCall();
535 535
536 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee(); 536 rtc::scoped_refptr<const RTCStatsReport> report = GetStatsFromCallee();
537 RTCStatsReportVerifier(report.get()).VerifyReport(); 537 RTCStatsReportVerifier(report.get()).VerifyReport();
538 } 538 }
539 539
540 TEST_F(RTCStatsIntegrationTest, GetsStatsWhileDestroyingPeerConnections) {
541 StartCall();
542
543 rtc::scoped_refptr<RTCStatsObtainer> stats_obtainer =
544 RTCStatsObtainer::Create();
545 caller_->pc()->GetStats(stats_obtainer);
546 // This will destroy the peer connection.
547 caller_ = nullptr;
548 // Any pending stats requests should have completed in the act of destroying
549 // the peer connection.
550 EXPECT_TRUE(stats_obtainer->report());
551 }
552
540 } // namespace 553 } // namespace
541 554
542 } // namespace webrtc 555 } // namespace webrtc
OLDNEW
« 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