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

Side by Side Diff: webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter_unittest.cc

Issue 2235373004: Probing: Add support for exponential startup probing (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@fix_probing2
Patch Set: lint fix Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 22 matching lines...) Expand all
33 public: 33 public:
34 TransportFeedbackAdapterTest() 34 TransportFeedbackAdapterTest()
35 : clock_(0), 35 : clock_(0),
36 bitrate_estimator_(nullptr), 36 bitrate_estimator_(nullptr),
37 bitrate_controller_(this), 37 bitrate_controller_(this),
38 receiver_estimated_bitrate_(0) {} 38 receiver_estimated_bitrate_(0) {}
39 39
40 virtual ~TransportFeedbackAdapterTest() {} 40 virtual ~TransportFeedbackAdapterTest() {}
41 41
42 virtual void SetUp() { 42 virtual void SetUp() {
43 adapter_.reset(new TransportFeedbackAdapter(&bitrate_controller_, &clock_)); 43 adapter_.reset(new TransportFeedbackAdapter(&clock_));
44 44
45 bitrate_estimator_ = new MockRemoteBitrateEstimator(); 45 bitrate_estimator_ = new MockRemoteBitrateEstimator();
46 adapter_->SetBitrateEstimator(bitrate_estimator_); 46 adapter_->SetBitrateEstimator(bitrate_estimator_);
47 } 47 }
48 48
49 virtual void TearDown() { 49 virtual void TearDown() {
50 adapter_.reset(); 50 adapter_.reset();
51 } 51 }
52 52
53 protected: 53 protected:
54 // Proxy class used since TransportFeedbackAdapter will own the instance 54 // Proxy class used since TransportFeedbackAdapter will own the instance
55 // passed at construction. 55 // passed at construction.
56 class MockBitrateControllerAdapter : public MockBitrateController { 56 class MockBitrateControllerAdapter : public MockBitrateController {
57 public: 57 public:
58 explicit MockBitrateControllerAdapter(TransportFeedbackAdapterTest* owner) 58 explicit MockBitrateControllerAdapter(TransportFeedbackAdapterTest* owner)
59 : MockBitrateController(), owner_(owner) {} 59 : MockBitrateController(), owner_(owner) {}
60 60
61 ~MockBitrateControllerAdapter() override {} 61 ~MockBitrateControllerAdapter() override {}
62 62
63 void UpdateDelayBasedEstimate(uint32_t bitrate_bps) override { 63 void OnReceiveBitrateChanged(const std::vector<uint32_t>& ssrcs,
64 uint32_t bitrate_bps) override {
64 owner_->receiver_estimated_bitrate_ = bitrate_bps; 65 owner_->receiver_estimated_bitrate_ = bitrate_bps;
65 } 66 }
66 67
67 TransportFeedbackAdapterTest* const owner_; 68 TransportFeedbackAdapterTest* const owner_;
68 }; 69 };
69 70
70 void OnReceivedEstimatedBitrate(uint32_t bitrate) {} 71 void OnReceivedEstimatedBitrate(uint32_t bitrate) {}
71 72
72 void OnReceivedRtcpReceiverReport(const ReportBlockList& report_blocks, 73 void OnReceivedRtcpReceiverReport(const ReportBlockList& report_blocks,
73 int64_t rtt, 74 int64_t rtt,
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 })); 355 }));
355 adapter_->OnTransportFeedback(*feedback.get()); 356 adapter_->OnTransportFeedback(*feedback.get());
356 357
357 expected_packets.push_back(info); 358 expected_packets.push_back(info);
358 359
359 ComparePacketVectors(expected_packets, received_feedback); 360 ComparePacketVectors(expected_packets, received_feedback);
360 } 361 }
361 362
362 } // namespace test 363 } // namespace test
363 } // namespace webrtc 364 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/remote_bitrate_estimator/transport_feedback_adapter.cc ('k') | webrtc/tools/event_log_visualizer/analyzer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698