2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
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.
11 #include "webrtc/modules/remote_bitrate_estimator/include/remote_bitrate_estimator.h"
12 #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test.h"
13 #include "webrtc/test/testsupport/fileutils.h"
18 #if BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
19 std::vector<BweTestConfig::EstimatorConfig> SingleEstimatorConfig() {
20 static const AbsoluteSendTimeRemoteBitrateEstimatorFactory factory =
21 AbsoluteSendTimeRemoteBitrateEstimatorFactory();
23 std::vector<BweTestConfig::EstimatorConfig> result;
24 result.push_back(BweTestConfig::EstimatorConfig("AST", &factory, kAimdControl,
29 std::vector<const PacketSenderFactory*> AdaptiveVideoSenderFactories(
31 static const AdaptiveVideoPacketSenderFactory factories[] = {
32 AdaptiveVideoPacketSenderFactory(30.00f, 150, 0x1234, 0.13f),
33 AdaptiveVideoPacketSenderFactory(30.00f, 300, 0x3456, 0.26f),
34 AdaptiveVideoPacketSenderFactory(15.00f, 600, 0x4567, 0.39f),
37 assert(count <= sizeof(factories) / sizeof(factories[0]));
39 std::vector<const PacketSenderFactory*> result;
40 for (uint32_t i = 0; i < count; ++i) {
41 result.push_back(&factories[i]);
46 BweTestConfig MakeAdaptiveBweTestConfig(uint32_t sender_count) {
47 BweTestConfig result = {
48 AdaptiveVideoSenderFactories(sender_count), SingleEstimatorConfig()
53 // This test fixture is used to instantiate tests running with adaptive video
55 class BweSimulation : public BweTest {
57 BweSimulation() : BweTest() {}
58 virtual ~BweSimulation() {}
61 DISALLOW_COPY_AND_ASSIGN(BweSimulation);
64 INSTANTIATE_TEST_CASE_P(VideoSendersTest, BweSimulation,
65 ::testing::Values(MakeAdaptiveBweTestConfig(1),
66 MakeAdaptiveBweTestConfig(3)));
68 TEST_P(BweSimulation, SprintUplinkTest) {
70 RateCounterFilter counter1(this, "sender_output");
71 TraceBasedDeliveryFilter filter(this, "link_capacity");
72 RateCounterFilter counter2(this, "receiver_input");
73 ASSERT_TRUE(filter.Init(test::ResourcePath("sprint-uplink", "rx")));
77 TEST_P(BweSimulation, Verizon4gDownlinkTest) {
79 RateCounterFilter counter1(this, "sender_output");
80 TraceBasedDeliveryFilter filter(this, "link_capacity");
81 RateCounterFilter counter2(this, "receiver_input");
82 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx")));
83 RunFor(22 * 60 * 1000);
85 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
87 } // namespace testing