Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); | 112 EXPECT_EQ(kPayloadType, statistics_proxy_->GetStats().current_payload_type); |
| 113 } | 113 } |
| 114 | 114 |
| 115 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { | 115 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecoderImplementationName) { |
| 116 const char* kName = "decoderName"; | 116 const char* kName = "decoderName"; |
| 117 statistics_proxy_->OnDecoderImplementationName(kName); | 117 statistics_proxy_->OnDecoderImplementationName(kName); |
| 118 EXPECT_STREQ( | 118 EXPECT_STREQ( |
| 119 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); | 119 kName, statistics_proxy_->GetStats().decoder_implementation_name.c_str()); |
| 120 } | 120 } |
| 121 | 121 |
| 122 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) { | 122 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsOnCompleteFrame) { |
|
åsapersson
2017/03/24 16:01:33
Did not add a test, cannot use fake clock with Rat
| |
| 123 const int kFrameSizeBytes = 1000; | 123 const int kFrameSizeBytes = 1000; |
| 124 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes); | 124 statistics_proxy_->OnCompleteFrame(true, kFrameSizeBytes); |
| 125 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); | 125 VideoReceiveStream::Stats stats = statistics_proxy_->GetStats(); |
| 126 EXPECT_EQ(1, stats.network_frame_rate); | 126 EXPECT_EQ(1, stats.network_frame_rate); |
| 127 EXPECT_EQ(kFrameSizeBytes * 8, stats.total_bitrate_bps); | |
| 128 EXPECT_EQ(1, stats.frame_counts.key_frames); | 127 EXPECT_EQ(1, stats.frame_counts.key_frames); |
| 129 EXPECT_EQ(0, stats.frame_counts.delta_frames); | 128 EXPECT_EQ(0, stats.frame_counts.delta_frames); |
| 130 } | 129 } |
| 131 | 130 |
| 132 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { | 131 TEST_F(ReceiveStatisticsProxyTest, GetStatsReportsDecodeTimingStats) { |
| 133 const int kDecodeMs = 1; | 132 const int kDecodeMs = 1; |
| 134 const int kMaxDecodeMs = 2; | 133 const int kMaxDecodeMs = 2; |
| 135 const int kCurrentDelayMs = 3; | 134 const int kCurrentDelayMs = 3; |
| 136 const int kTargetDelayMs = 4; | 135 const int kTargetDelayMs = 4; |
| 137 const int kJitterBufferMs = 5; | 136 const int kJitterBufferMs = 5; |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 389 codec_info.codecType = kVideoCodecVP8; | 388 codec_info.codecType = kVideoCodecVP8; |
| 390 | 389 |
| 391 for (int i = 0; i < kMinRequiredSamples; ++i) | 390 for (int i = 0; i < kMinRequiredSamples; ++i) |
| 392 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); | 391 statistics_proxy_->OnPreDecode(encoded_image, &codec_info); |
| 393 | 392 |
| 394 statistics_proxy_.reset(); | 393 statistics_proxy_.reset(); |
| 395 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); | 394 EXPECT_EQ(0, metrics::NumSamples("WebRTC.Video.Decoded.Vp8.Qp")); |
| 396 } | 395 } |
| 397 | 396 |
| 398 } // namespace webrtc | 397 } // namespace webrtc |
| OLD | NEW |