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

Unified Diff: webrtc/pc/peerconnectioninterface_unittest.cc

Issue 2682433005: Fix the Chrome crash caused by RtcEventLog (Closed)
Patch Set: Add a unit test. Created 3 years, 10 months 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/pc/peerconnection.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/peerconnectioninterface_unittest.cc
diff --git a/webrtc/pc/peerconnectioninterface_unittest.cc b/webrtc/pc/peerconnectioninterface_unittest.cc
index 90f48549902535e63904b8de80c94f945e0e247b..f7d477781abf855701d1cb0379e021f09f4bf271 100644
--- a/webrtc/pc/peerconnectioninterface_unittest.cc
+++ b/webrtc/pc/peerconnectioninterface_unittest.cc
@@ -3100,6 +3100,20 @@ TEST_F(PeerConnectionInterfaceTest, CurrentAndPendingDescriptions) {
EXPECT_EQ(local_answer, pc_->current_local_description());
}
+// Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog
+// after the PeerConnection is closed.
+TEST_F(PeerConnectionInterfaceTest,
+ StartAndStopLoggingAfterPeerConnectionClosed) {
+ CreatePeerConnection();
+ // The RtcEventLog will be reset when the PeerConnection is closed.
+ pc_->Close();
+
+ rtc::PlatformFile file = 0;
+ int64_t max_size_bytes = 1024;
+ EXPECT_FALSE(pc_->StartRtcEventLog(file, max_size_bytes));
+ pc_->StopRtcEventLog();
+}
+
class PeerConnectionMediaConfigTest : public testing::Test {
protected:
void SetUp() override {
« no previous file with comments | « webrtc/pc/peerconnection.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698