Change RtcpPacket::PacketReadyCallback to rtc::FunctionView

from interface


Bug: webrtc:5565
Change-Id: I2df5d7a0554b938888581f1c73dbdb8b85c387cc
Reviewed-on: https://webrtc-review.googlesource.com/8680
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21136}
This commit is contained in:
Danil Chapovalov
2017-12-07 10:15:53 +01:00
committed by Commit Bot
parent f1061c2d90
commit 5c3cc41cef
39 changed files with 158 additions and 209 deletions

View File

@ -13,10 +13,12 @@
#include "test/gmock.h"
#include "test/gtest.h"
using webrtc::rtcp::ReceiverReport;
using webrtc::rtcp::ReportBlock;
namespace {
namespace webrtc {
using ::testing::_;
using ::testing::MockFunction;
using ::webrtc::rtcp::ReceiverReport;
using ::webrtc::rtcp::ReportBlock;
const uint32_t kSenderSsrc = 0x12345678;
@ -30,13 +32,10 @@ TEST(RtcpPacketTest, BuildWithTooSmallBuffer) {
const size_t kReportBlockLength = 24;
// No packet.
class Verifier : public rtcp::RtcpPacket::PacketReadyCallback {
void OnPacketReady(uint8_t* data, size_t length) override {
ADD_FAILURE() << "Packet should not fit within max size.";
}
} verifier;
MockFunction<void(rtc::ArrayView<const uint8_t>)> callback;
EXPECT_CALL(callback, Call(_)).Times(0);
const size_t kBufferSize = kRrLength + kReportBlockLength - 1;
uint8_t buffer[kBufferSize];
EXPECT_FALSE(rr.BuildExternalBuffer(buffer, kBufferSize, &verifier));
EXPECT_FALSE(rr.Build(kBufferSize, callback.AsStdFunction()));
}
} // namespace webrtc
} // namespace