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 RemoteBitrateEstimatorFactory factory =
21 AbsoluteSendTimeRemoteBitrateEstimatorFactory();
23 std::vector<BweTestConfig::EstimatorConfig> result;
24 result.push_back(BweTestConfig::EstimatorConfig("AST", &factory));
28 std::vector<const PacketSenderFactory*> AdaptiveVideoSenderFactories(
30 static const AdaptiveVideoPacketSenderFactory factories[] = {
31 AdaptiveVideoPacketSenderFactory(30.00f, 150, 0x1234, 0.13f),
32 AdaptiveVideoPacketSenderFactory(30.00f, 300, 0x3456, 0.26f),
33 AdaptiveVideoPacketSenderFactory(15.00f, 600, 0x4567, 0.39f),
36 assert(count <= sizeof(factories) / sizeof(factories[0]));
38 std::vector<const PacketSenderFactory*> result;
39 for (uint32_t i = 0; i < count; ++i) {
40 result.push_back(&factories[i]);
45 BweTestConfig MakeAdaptiveBweTestConfig(uint32_t sender_count) {
46 BweTestConfig result = {
47 AdaptiveVideoSenderFactories(sender_count), SingleEstimatorConfig()
52 // This test fixture is used to instantiate tests running with adaptive video
54 class BweSimulation : public BweTest {
56 BweSimulation() : BweTest() {}
57 virtual ~BweSimulation() {}
60 DISALLOW_COPY_AND_ASSIGN(BweSimulation);
63 INSTANTIATE_TEST_CASE_P(VideoSendersTest, BweSimulation,
64 ::testing::Values(MakeAdaptiveBweTestConfig(1),
65 MakeAdaptiveBweTestConfig(3)));
67 TEST_P(BweSimulation, SprintUplinkTest) {
69 RateCounterFilter counter1(this, "sender_output");
70 TraceBasedDeliveryFilter filter(this, "link_capacity");
71 RateCounterFilter counter2(this, "receiver_input");
72 ASSERT_TRUE(filter.Init(test::ResourcePath("sprint-uplink", "rx")));
76 TEST_P(BweSimulation, Verizon4gDownlinkTest) {
78 RateCounterFilter counter1(this, "sender_output");
79 TraceBasedDeliveryFilter filter(this, "link_capacity");
80 RateCounterFilter counter2(this, "receiver_input");
81 ASSERT_TRUE(filter.Init(test::ResourcePath("verizon4g-downlink", "rx")));
82 RunFor(22 * 60 * 1000);
84 #endif // BWE_TEST_LOGGING_COMPILE_TIME_ENABLE
86 } // namespace testing