This will allow me to test that Call invokes SendSideCongestionController::SetBweBitrates as expected (for https://codereview.chromium.org/2793913008).

FakeRtpTransportController moves to a common header and its constructor is changed to take a SendSideCongestionController to enable injecting the mock.

BUG=webrtc:7395

Review-Url: https://codereview.webrtc.org/2834663003
Cr-Commit-Position: refs/heads/master@{#18055}
This commit is contained in:
zstein
2017-05-08 11:52:38 -07:00
committed by Commit bot
parent 966963ac7d
commit 7cb69d5cc7
14 changed files with 167 additions and 52 deletions

View File

@ -11,9 +11,6 @@
#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_OBSERVER_H_
#define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_CONGESTION_OBSERVER_H_
#include "webrtc/base/constructormagic.h"
#include "webrtc/base/socket.h"
#include "webrtc/common_types.h"
#include "webrtc/modules/congestion_controller/include/congestion_controller.h"
#include "webrtc/test/gmock.h"

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2017 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.
*/
#ifndef WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_SEND_SIDE_CONGESTION_CONTROLLER_H_
#define WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_SEND_SIDE_CONGESTION_CONTROLLER_H_
#include "webrtc/modules/congestion_controller/include/send_side_congestion_controller.h"
#include "webrtc/test/gmock.h"
namespace webrtc {
namespace test {
class MockSendSideCongestionController : public SendSideCongestionController {
public:
MockSendSideCongestionController(const Clock* clock,
RtcEventLog* event_log,
PacketRouter* packet_router)
: SendSideCongestionController(clock,
nullptr /* observer */,
event_log,
packet_router) {}
MOCK_METHOD3(SetBweBitrates,
void(int min_bitrate_bps,
int start_bitrate_bps,
int max_bitrate_bps));
};
} // namespace test
} // namespace webrtc
#endif // WEBRTC_MODULES_CONGESTION_CONTROLLER_INCLUDE_MOCK_MOCK_SEND_SIDE_CONGESTION_CONTROLLER_H_