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

Unified Diff: webrtc/p2p/base/p2ptransportchannel_unittest.cc

Issue 2416023002: Introduce rtc::PacketTransportInterface and let cricket::TransportChannel inherit. (Closed)
Patch Set: Let BaseChannel::PacketIsRtcp() use PacketTransportInterface. Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/p2p/base/p2ptransportchannel_unittest.cc
diff --git a/webrtc/p2p/base/p2ptransportchannel_unittest.cc b/webrtc/p2p/base/p2ptransportchannel_unittest.cc
index 7e65b4baba93d22a4cac78b71b31705229006f04..77d9e01fb723994575a5b566cb86ec7b00685cbd 100644
--- a/webrtc/p2p/base/p2ptransportchannel_unittest.cc
+++ b/webrtc/p2p/base/p2ptransportchannel_unittest.cc
@@ -13,6 +13,7 @@
#include "webrtc/api/fakemetricsobserver.h"
#include "webrtc/p2p/base/fakeportallocator.h"
+#include "webrtc/p2p/base/packettransportinterface.h"
#include "webrtc/p2p/base/p2ptransportchannel.h"
#include "webrtc/p2p/base/testrelayserver.h"
#include "webrtc/p2p/base/teststunserver.h"
@@ -670,8 +671,9 @@ class P2PTransportChannelTestBase : public testing::Test,
TestSendRecv();
}
- void OnReadyToSend(TransportChannel* ch) {
- GetEndpoint(ch)->ready_to_send_ = true;
+ void OnReadyToSend(rtc::PacketTransportInterface* transport) {
+ GetEndpoint(static_cast<TransportChannel*>(transport))->ready_to_send_ =
+ true;
}
// We pass the candidates directly to the other side.
@@ -777,14 +779,17 @@ class P2PTransportChannelTestBase : public testing::Test,
}
}
}
- void OnReadPacket(TransportChannel* channel,
+
+ void OnReadPacket(rtc::PacketTransportInterface* transport,
const char* data,
size_t len,
const rtc::PacketTime& packet_time,
int flags) {
- std::list<std::string>& packets = GetPacketList(channel);
+ std::list<std::string>& packets =
+ GetPacketList(static_cast<TransportChannel*>(transport));
packets.push_front(std::string(data, len));
}
+
void OnRoleConflict(TransportChannelImpl* channel) {
GetEndpoint(channel)->OnRoleConflict(true);
IceRole new_role = GetEndpoint(channel)->ice_role() == ICEROLE_CONTROLLING
@@ -2909,7 +2914,7 @@ class P2PTransportChannelPingTest : public testing::Test,
conn->OnReadPacket(buf.Data(), buf.Length(), rtc::CreatePacketTime(0));
}
- void OnReadyToSend(TransportChannel* channel) {
+ void OnReadyToSend(rtc::PacketTransportInterface* transport) {
channel_ready_to_send_ = true;
}
void OnChannelStateChanged(TransportChannelImpl* channel) {

Powered by Google App Engine
This is Rietveld 408576698