| OLD | NEW |
| 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 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 callback->StatisticsUpdated(ssrc_stats.rtcp_stats, ssrc); | 139 callback->StatisticsUpdated(ssrc_stats.rtcp_stats, ssrc); |
| 140 } | 140 } |
| 141 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | 141 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); |
| 142 ExpectEqual(expected_, stats); | 142 ExpectEqual(expected_, stats); |
| 143 } | 143 } |
| 144 | 144 |
| 145 TEST_F(SendStatisticsProxyTest, EncodedBitrateAndFramerate) { | 145 TEST_F(SendStatisticsProxyTest, EncodedBitrateAndFramerate) { |
| 146 int media_bitrate_bps = 500; | 146 int media_bitrate_bps = 500; |
| 147 int encode_fps = 29; | 147 int encode_fps = 29; |
| 148 | 148 |
| 149 statistics_proxy_->OnEncoderStatsUpdate(encode_fps, media_bitrate_bps, | 149 statistics_proxy_->OnEncoderStatsUpdate(encode_fps, media_bitrate_bps); |
| 150 "encoder name"); | |
| 151 | 150 |
| 152 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); | 151 VideoSendStream::Stats stats = statistics_proxy_->GetStats(); |
| 153 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps); | 152 EXPECT_EQ(media_bitrate_bps, stats.media_bitrate_bps); |
| 154 EXPECT_EQ(encode_fps, stats.encode_frame_rate); | 153 EXPECT_EQ(encode_fps, stats.encode_frame_rate); |
| 155 EXPECT_EQ("encoder name", stats.encoder_implementation_name); | |
| 156 } | 154 } |
| 157 | 155 |
| 158 TEST_F(SendStatisticsProxyTest, Suspended) { | 156 TEST_F(SendStatisticsProxyTest, Suspended) { |
| 159 // Verify that the value is false by default. | 157 // Verify that the value is false by default. |
| 160 EXPECT_FALSE(statistics_proxy_->GetStats().suspended); | 158 EXPECT_FALSE(statistics_proxy_->GetStats().suspended); |
| 161 | 159 |
| 162 // Verify that we can set it to true. | 160 // Verify that we can set it to true. |
| 163 statistics_proxy_->OnSuspendChange(true); | 161 statistics_proxy_->OnSuspendChange(true); |
| 164 EXPECT_TRUE(statistics_proxy_->GetStats().suspended); | 162 EXPECT_TRUE(statistics_proxy_->GetStats().suspended); |
| 165 | 163 |
| (...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 | 738 |
| 741 EXPECT_EQ( | 739 EXPECT_EQ( |
| 742 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); | 740 1, metrics::NumSamples("WebRTC.Video.Screenshare.FecBitrateSentInKbps")); |
| 743 EXPECT_EQ(1, metrics::NumEvents( | 741 EXPECT_EQ(1, metrics::NumEvents( |
| 744 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", | 742 "WebRTC.Video.Screenshare.FecBitrateSentInKbps", |
| 745 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / | 743 static_cast<int>((rtx_counters.fec.TotalBytes() * 2 * 8) / |
| 746 metrics::kMinRunTimeInSeconds / 1000))); | 744 metrics::kMinRunTimeInSeconds / 1000))); |
| 747 } | 745 } |
| 748 | 746 |
| 749 } // namespace webrtc | 747 } // namespace webrtc |
| OLD | NEW |