tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

delay_manager_unittest.cc (1032B)


      1 /*
      2 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
      3 *
      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
      6 *  tree. An additional intellectual property rights grant can be found
      7 *  in the file PATENTS.  All contributing project authors may
      8 *  be found in the AUTHORS file in the root of the source tree.
      9 */
     10 
     11 // Unit tests for DelayManager class.
     12 
     13 #include "modules/audio_coding/neteq/delay_manager.h"
     14 
     15 #include "api/neteq/neteq_controller.h"
     16 #include "api/neteq/tick_timer.h"
     17 #include "test/create_test_field_trials.h"
     18 #include "test/gtest.h"
     19 
     20 namespace webrtc {
     21 namespace {
     22 
     23 TEST(DelayManagerTest, UpdateNormal) {
     24  TickTimer tick_timer;
     25  DelayManager dm(DelayManager::Config(CreateTestFieldTrials()), &tick_timer);
     26  for (int i = 0; i < 50; ++i) {
     27    dm.Update(0, false, NetEqController::PacketArrivedInfo());
     28    tick_timer.Increment(2);
     29  }
     30  EXPECT_EQ(20, dm.TargetDelayMs());
     31 }
     32 
     33 }  // namespace
     34 }  // namespace webrtc