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

Side by Side Diff: webrtc/video/end_to_end_tests.cc

Issue 1669623004: Use CallStats for RTT in Call, rather than VideoSendStream::GetRtt() (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Addressed comments Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 #include <algorithm> 10 #include <algorithm>
(...skipping 2079 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 screenshare_(screenshare), 2090 screenshare_(screenshare),
2091 sender_call_(nullptr), 2091 sender_call_(nullptr),
2092 receiver_call_(nullptr), 2092 receiver_call_(nullptr),
2093 start_runtime_ms_(-1) {} 2093 start_runtime_ms_(-1) {}
2094 2094
2095 private: 2095 private:
2096 Action OnSendRtp(const uint8_t* packet, size_t length) override { 2096 Action OnSendRtp(const uint8_t* packet, size_t length) override {
2097 if (MinMetricRunTimePassed()) 2097 if (MinMetricRunTimePassed())
2098 observation_complete_.Set(); 2098 observation_complete_.Set();
2099 2099
2100 // GetStats calls GetSendChannelRtcpStatistics
2101 // (via VideoSendStream::GetRtt) which updates ReportBlockStats used by
2102 // WebRTC.Video.SentPacketsLostInPercent.
2103 // TODO(asapersson): Remove dependency on calling GetStats.
2104 sender_call_->GetStats();
2105
2106 return SEND_PACKET; 2100 return SEND_PACKET;
2107 } 2101 }
2108 2102
2109 bool MinMetricRunTimePassed() { 2103 bool MinMetricRunTimePassed() {
2110 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); 2104 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds();
2111 if (start_runtime_ms_ == -1) { 2105 if (start_runtime_ms_ == -1) {
2112 start_runtime_ms_ = now; 2106 start_runtime_ms_ = now;
2113 return false; 2107 return false;
2114 } 2108 }
2115 int64_t elapsed_sec = (now - start_runtime_ms_) / 1000; 2109 int64_t elapsed_sec = (now - start_runtime_ms_) / 1000;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
2192 EXPECT_EQ(1, test::NumHistogramSamples( 2186 EXPECT_EQ(1, test::NumHistogramSamples(
2193 "WebRTC.Video.PliPacketsSentPerMinute")); 2187 "WebRTC.Video.PliPacketsSentPerMinute"));
2194 EXPECT_EQ(1, test::NumHistogramSamples( 2188 EXPECT_EQ(1, test::NumHistogramSamples(
2195 "WebRTC.Video.PliPacketsReceivedPerMinute")); 2189 "WebRTC.Video.PliPacketsReceivedPerMinute"));
2196 2190
2197 EXPECT_EQ( 2191 EXPECT_EQ(
2198 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille")); 2192 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille"));
2199 EXPECT_EQ(1, test::NumHistogramSamples( 2193 EXPECT_EQ(1, test::NumHistogramSamples(
2200 "WebRTC.Video.KeyFramesReceivedInPermille")); 2194 "WebRTC.Video.KeyFramesReceivedInPermille"));
2201 2195
2202 EXPECT_EQ(1, test::NumHistogramSamples( 2196 EXPECT_EQ(
2203 "WebRTC.Video.SentPacketsLostInPercent")); 2197 1, test::NumHistogramSamples(video_prefix + "SentPacketsLostInPercent"));
2204 EXPECT_EQ(1, test::NumHistogramSamples( 2198 EXPECT_EQ(1, test::NumHistogramSamples(
2205 "WebRTC.Video.ReceivedPacketsLostInPercent")); 2199 "WebRTC.Video.ReceivedPacketsLostInPercent"));
2206 2200
2207 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels")); 2201 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels"));
2208 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels")); 2202 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels"));
2209 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels")); 2203 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels"));
2210 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels")); 2204 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels"));
2211 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels")); 2205 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels"));
2212 EXPECT_EQ(1, 2206 EXPECT_EQ(1,
2213 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels")); 2207 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels"));
(...skipping 1300 matching lines...) Expand 10 before | Expand all | Expand 10 after
3514 private: 3508 private:
3515 bool video_observed_; 3509 bool video_observed_;
3516 bool audio_observed_; 3510 bool audio_observed_;
3517 SequenceNumberUnwrapper unwrapper_; 3511 SequenceNumberUnwrapper unwrapper_;
3518 std::set<int64_t> received_packet_ids_; 3512 std::set<int64_t> received_packet_ids_;
3519 } test; 3513 } test;
3520 3514
3521 RunBaseTest(&test); 3515 RunBaseTest(&test);
3522 } 3516 }
3523 } // namespace webrtc 3517 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698