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

Unified Diff: webrtc/voice_engine/network_predictor_unittest.cc

Issue 2390883004: Hooking up audio network adaptor to VoE. (Closed)
Patch Set: adding a comment Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/voice_engine/network_predictor.cc ('k') | webrtc/voice_engine/voice_engine.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/voice_engine/network_predictor_unittest.cc
diff --git a/webrtc/voice_engine/network_predictor_unittest.cc b/webrtc/voice_engine/network_predictor_unittest.cc
deleted file mode 100644
index 9012379c7503656bbfbd03f340596157d087b410..0000000000000000000000000000000000000000
--- a/webrtc/voice_engine/network_predictor_unittest.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <math.h>
-
-#include <memory>
-
-#include "webrtc/system_wrappers/include/clock.h"
-#include "webrtc/test/gtest.h"
-#include "webrtc/voice_engine/network_predictor.h"
-
-namespace webrtc {
-namespace voe {
-
-class TestNetworkPredictor : public ::testing::Test {
- protected:
- TestNetworkPredictor()
- : clock_(0),
- network_predictor_(new NetworkPredictor(&clock_)) {}
- SimulatedClock clock_;
- std::unique_ptr<NetworkPredictor> network_predictor_;
-};
-
-TEST_F(TestNetworkPredictor, TestPacketLossRateFilter) {
- // Test initial packet loss rate estimate is 0.
- EXPECT_EQ(0, network_predictor_->GetLossRate());
- network_predictor_->UpdatePacketLossRate(32);
- // First time, no filtering.
- EXPECT_EQ(32, network_predictor_->GetLossRate());
- clock_.AdvanceTimeMilliseconds(1000);
- network_predictor_->UpdatePacketLossRate(40);
- float exp = pow(0.9999f, 1000);
- float value = 32.0f * exp + (1 - exp) * 40.0f;
- EXPECT_EQ(static_cast<uint8_t>(value + 0.5f),
- network_predictor_->GetLossRate());
-}
-} // namespace voe
-} // namespace webrtc
« no previous file with comments | « webrtc/voice_engine/network_predictor.cc ('k') | webrtc/voice_engine/voice_engine.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698