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

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 comment, rebase 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
« no previous file with comments | « webrtc/video/call_stats_unittest.cc ('k') | webrtc/video/send_statistics_proxy.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 (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 2088 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 : nullptr), 2099 : nullptr),
2100 sender_call_(nullptr), 2100 sender_call_(nullptr),
2101 receiver_call_(nullptr), 2101 receiver_call_(nullptr),
2102 start_runtime_ms_(-1) {} 2102 start_runtime_ms_(-1) {}
2103 2103
2104 private: 2104 private:
2105 Action OnSendRtp(const uint8_t* packet, size_t length) override { 2105 Action OnSendRtp(const uint8_t* packet, size_t length) override {
2106 if (MinMetricRunTimePassed()) 2106 if (MinMetricRunTimePassed())
2107 observation_complete_.Set(); 2107 observation_complete_.Set();
2108 2108
2109 // GetStats calls GetSendChannelRtcpStatistics
2110 // (via VideoSendStream::GetRtt) which updates ReportBlockStats used by
2111 // WebRTC.Video.SentPacketsLostInPercent.
2112 // TODO(asapersson): Remove dependency on calling GetStats.
2113 sender_call_->GetStats();
2114
2115 return SEND_PACKET; 2109 return SEND_PACKET;
2116 } 2110 }
2117 2111
2118 bool MinMetricRunTimePassed() { 2112 bool MinMetricRunTimePassed() {
2119 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds(); 2113 int64_t now = Clock::GetRealTimeClock()->TimeInMilliseconds();
2120 if (start_runtime_ms_ == -1) { 2114 if (start_runtime_ms_ == -1) {
2121 start_runtime_ms_ = now; 2115 start_runtime_ms_ = now;
2122 return false; 2116 return false;
2123 } 2117 }
2124 int64_t elapsed_sec = (now - start_runtime_ms_) / 1000; 2118 int64_t elapsed_sec = (now - start_runtime_ms_) / 1000;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
2205 EXPECT_EQ(1, test::NumHistogramSamples( 2199 EXPECT_EQ(1, test::NumHistogramSamples(
2206 "WebRTC.Video.PliPacketsSentPerMinute")); 2200 "WebRTC.Video.PliPacketsSentPerMinute"));
2207 EXPECT_EQ(1, test::NumHistogramSamples( 2201 EXPECT_EQ(1, test::NumHistogramSamples(
2208 "WebRTC.Video.PliPacketsReceivedPerMinute")); 2202 "WebRTC.Video.PliPacketsReceivedPerMinute"));
2209 2203
2210 EXPECT_EQ( 2204 EXPECT_EQ(
2211 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille")); 2205 1, test::NumHistogramSamples(video_prefix + "KeyFramesSentInPermille"));
2212 EXPECT_EQ(1, test::NumHistogramSamples( 2206 EXPECT_EQ(1, test::NumHistogramSamples(
2213 "WebRTC.Video.KeyFramesReceivedInPermille")); 2207 "WebRTC.Video.KeyFramesReceivedInPermille"));
2214 2208
2215 EXPECT_EQ(1, test::NumHistogramSamples( 2209 EXPECT_EQ(
2216 "WebRTC.Video.SentPacketsLostInPercent")); 2210 1, test::NumHistogramSamples(video_prefix + "SentPacketsLostInPercent"));
2217 EXPECT_EQ(1, test::NumHistogramSamples( 2211 EXPECT_EQ(1, test::NumHistogramSamples(
2218 "WebRTC.Video.ReceivedPacketsLostInPercent")); 2212 "WebRTC.Video.ReceivedPacketsLostInPercent"));
2219 2213
2220 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels")); 2214 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputWidthInPixels"));
2221 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels")); 2215 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "InputHeightInPixels"));
2222 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels")); 2216 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentWidthInPixels"));
2223 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels")); 2217 EXPECT_EQ(1, test::NumHistogramSamples(video_prefix + "SentHeightInPixels"));
2224 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels")); 2218 EXPECT_EQ(1, test::NumHistogramSamples("WebRTC.Video.ReceivedWidthInPixels"));
2225 EXPECT_EQ(1, 2219 EXPECT_EQ(1,
2226 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels")); 2220 test::NumHistogramSamples("WebRTC.Video.ReceivedHeightInPixels"));
(...skipping 1305 matching lines...) Expand 10 before | Expand all | Expand 10 after
3532 private: 3526 private:
3533 bool video_observed_; 3527 bool video_observed_;
3534 bool audio_observed_; 3528 bool audio_observed_;
3535 SequenceNumberUnwrapper unwrapper_; 3529 SequenceNumberUnwrapper unwrapper_;
3536 std::set<int64_t> received_packet_ids_; 3530 std::set<int64_t> received_packet_ids_;
3537 } test; 3531 } test;
3538 3532
3539 RunBaseTest(&test); 3533 RunBaseTest(&test);
3540 } 3534 }
3541 } // namespace webrtc 3535 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/call_stats_unittest.cc ('k') | webrtc/video/send_statistics_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698