Index: webrtc/video/video_send_stream_tests.cc |
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc |
index 0f44c6fd5224f40386e14c5b05247e3966ed311f..a1d74757f062f8d7327b0519019e6d5db74f2ce2 100644 |
--- a/webrtc/video/video_send_stream_tests.cc |
+++ b/webrtc/video/video_send_stream_tests.cc |
@@ -1522,6 +1522,7 @@ TEST_F(VideoSendStreamTest, RtcpSenderReportContainsMediaBytesSent) { |
private: |
Action OnSendRtp(const uint8_t* packet, size_t length) override { |
+ rtc::CritScope lock(&crit_); |
RTPHeader header; |
EXPECT_TRUE(parser_->Parse(packet, length, &header)); |
++rtp_packets_sent_; |
@@ -1530,6 +1531,7 @@ TEST_F(VideoSendStreamTest, RtcpSenderReportContainsMediaBytesSent) { |
} |
Action OnSendRtcp(const uint8_t* packet, size_t length) override { |
+ rtc::CritScope lock(&crit_); |
RTCPUtility::RTCPParserV2 parser(packet, length, true); |
EXPECT_TRUE(parser.IsValid()); |
@@ -1556,8 +1558,9 @@ TEST_F(VideoSendStreamTest, RtcpSenderReportContainsMediaBytesSent) { |
<< "Timed out while waiting for RTCP sender report."; |
} |
- size_t rtp_packets_sent_; |
- size_t media_bytes_sent_; |
+ rtc::CriticalSection crit_; |
+ size_t rtp_packets_sent_ GUARDED_BY(&crit_); |
+ size_t media_bytes_sent_ GUARDED_BY(&crit_); |
} test; |
RunBaseTest(&test, FakeNetworkPipe::Config()); |