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

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

Issue 2606123002: Remove the dependency of TransportChannel and TransportChannelImpl. (Closed)
Patch Set: Fix the format. Created 3 years, 11 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/dtlstransportchannel_unittest.cc
diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
index bff2e7da5d27ff18285a402d1f65c78a0a54ea0a..4b21b2f9238e0c5d0d7f7b7d9d56d9279a225ba4 100644
--- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc
+++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc
@@ -96,11 +96,12 @@ class DtlsTestClient : public sigslot::has_slots<> {
fake_ice_channel->SignalReadPacket.connect(
this, &DtlsTestClient::OnFakeTransportChannelReadPacket);
- cricket::DtlsTransportChannelWrapper* channel =
- new cricket::DtlsTransportChannelWrapper(fake_ice_channel);
+ cricket::DtlsTransport* channel =
+ new cricket::DtlsTransport(fake_ice_channel);
channel->SetLocalCertificate(certificate_);
- channel->SetIceRole(role);
- channel->SetIceTiebreaker((role == cricket::ICEROLE_CONTROLLING) ? 1 : 2);
+ channel->ice_transport()->SetIceRole(role);
+ channel->ice_transport()->SetIceTiebreaker(
+ (role == cricket::ICEROLE_CONTROLLING) ? 1 : 2);
channel->SetSslMaxProtocolVersion(ssl_max_version_);
channel->SignalWritableState.connect(this,
&DtlsTestClient::OnTransportChannelWritableState);
@@ -108,8 +109,7 @@ class DtlsTestClient : public sigslot::has_slots<> {
&DtlsTestClient::OnTransportChannelReadPacket);
channel->SignalSentPacket.connect(
this, &DtlsTestClient::OnTransportChannelSentPacket);
- channels_.push_back(
- std::unique_ptr<cricket::DtlsTransportChannelWrapper>(channel));
+ channels_.push_back(std::unique_ptr<cricket::DtlsTransport>(channel));
fake_channels_.push_back(
std::unique_ptr<cricket::FakeIceTransport>(fake_ice_channel));
transport_->AddChannel(channel, i);
@@ -127,7 +127,7 @@ class DtlsTestClient : public sigslot::has_slots<> {
return nullptr;
}
- cricket::DtlsTransportChannelWrapper* GetDtlsChannel(int component) {
+ cricket::DtlsTransport* GetDtlsChannel(int component) {
for (const auto& ch : channels_) {
if (ch->component() == component) {
return ch.get();
@@ -231,12 +231,12 @@ class DtlsTestClient : public sigslot::has_slots<> {
return true;
}
- bool all_raw_channels_writable() const {
+ bool all_ice_transport_writable() const {
pthatcher1 2017/01/17 20:16:48 all_ice_transports_writable()
if (channels_.empty()) {
return false;
}
for (const auto& channel : channels_) {
pthatcher1 2017/01/17 20:16:48 transport : transports_
- if (!channel->channel()->writable()) {
+ if (!channel->ice_transport()->writable()) {
return false;
}
}
@@ -435,7 +435,7 @@ class DtlsTestClient : public sigslot::has_slots<> {
std::string name_;
rtc::scoped_refptr<rtc::RTCCertificate> certificate_;
std::vector<std::unique_ptr<cricket::FakeIceTransport>> fake_channels_;
- std::vector<std::unique_ptr<cricket::DtlsTransportChannelWrapper>> channels_;
+ std::vector<std::unique_ptr<cricket::DtlsTransport>> channels_;
std::unique_ptr<cricket::JsepTransport> transport_;
size_t packet_size_ = 0u;
std::set<int> received_;
@@ -993,12 +993,12 @@ TEST_F(DtlsTransportChannelTest, TestRetransmissionSchedule) {
// Make client2_ writable, but not client1_.
// This means client1_ will send DTLS client hellos but get no response.
EXPECT_TRUE(client2_.Connect(&client1_, true));
- EXPECT_TRUE_SIMULATED_WAIT(client2_.all_raw_channels_writable(), kTimeout,
+ EXPECT_TRUE_SIMULATED_WAIT(client2_.all_ice_transport_writable(), kTimeout,
fake_clock_);
// Wait for the first client hello to be sent.
EXPECT_EQ_WAIT(1, client1_.received_dtls_client_hellos(), kTimeout);
- EXPECT_FALSE(client1_.all_raw_channels_writable());
+ EXPECT_FALSE(client1_.all_ice_transport_writable());
static int timeout_schedule_ms[] = {50, 100, 200, 400, 800, 1600,
3200, 6400, 12800, 25600, 51200, 60000};
@@ -1103,7 +1103,7 @@ class DtlsEventOrderingTest
break;
case CALLER_WRITABLE:
EXPECT_TRUE(client1_.Connect(&client2_, true));
- EXPECT_TRUE_SIMULATED_WAIT(client1_.all_raw_channels_writable(),
+ EXPECT_TRUE_SIMULATED_WAIT(client1_.all_ice_transport_writable(),
kTimeout, fake_clock_);
break;
case CALLER_RECEIVES_CLIENTHELLO:
@@ -1111,7 +1111,7 @@ class DtlsEventOrderingTest
EXPECT_EQ(0, client1_.received_dtls_client_hellos());
// Making client2_ writable will cause it to send the ClientHello.
EXPECT_TRUE(client2_.Connect(&client1_, true));
- EXPECT_TRUE_SIMULATED_WAIT(client2_.all_raw_channels_writable(),
+ EXPECT_TRUE_SIMULATED_WAIT(client2_.all_ice_transport_writable(),
kTimeout, fake_clock_);
EXPECT_EQ_SIMULATED_WAIT(1, client1_.received_dtls_client_hellos(),
kTimeout, fake_clock_);

Powered by Google App Engine
This is Rietveld 408576698