Index: webrtc/p2p/base/dtlstransportchannel_unittest.cc |
diff --git a/webrtc/p2p/base/dtlstransportchannel_unittest.cc b/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
index 8c1c21cd1e365928e12f6211334da7a00af521ad..b90ffebf5a139009b298404b74883804da2c2d4c 100644 |
--- a/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
+++ b/webrtc/p2p/base/dtlstransportchannel_unittest.cc |
@@ -11,7 +11,7 @@ |
#include <set> |
#include "webrtc/p2p/base/dtlstransport.h" |
-#include "webrtc/p2p/base/fakesession.h" |
+#include "webrtc/p2p/base/faketransportcontroller.h" |
#include "webrtc/base/common.h" |
#include "webrtc/base/dscp.h" |
#include "webrtc/base/gunit.h" |
@@ -21,7 +21,6 @@ |
#include "webrtc/base/sslidentity.h" |
#include "webrtc/base/sslstreamadapter.h" |
#include "webrtc/base/stringutils.h" |
-#include "webrtc/base/thread.h" |
#define MAYBE_SKIP_TEST(feature) \ |
if (!(rtc::SSLStreamAdapter::feature())) { \ |
@@ -45,12 +44,8 @@ enum Flags { NF_REOFFER = 0x1, NF_EXPECT_FAILURE = 0x2 }; |
class DtlsTestClient : public sigslot::has_slots<> { |
public: |
- DtlsTestClient(const std::string& name, |
- rtc::Thread* signaling_thread, |
- rtc::Thread* worker_thread) : |
+ DtlsTestClient(const std::string& name) : |
name_(name), |
- signaling_thread_(signaling_thread), |
- worker_thread_(worker_thread), |
protocol_(cricket::ICEPROTO_GOOGLE), |
packet_size_(0), |
use_dtls_srtp_(false), |
@@ -76,8 +71,7 @@ class DtlsTestClient : public sigslot::has_slots<> { |
} |
void SetupChannels(int count, cricket::IceRole role) { |
transport_.reset(new cricket::DtlsTransport<cricket::FakeTransport>( |
- signaling_thread_, worker_thread_, "dtls content name", NULL, |
- identity_.get())); |
+ "dtls content name", NULL, identity_.get())); |
transport_->SetAsync(true); |
transport_->SetIceRole(role); |
transport_->SetIceTiebreaker( |
@@ -201,7 +195,9 @@ class DtlsTestClient : public sigslot::has_slots<> { |
return true; |
} |
- bool writable() const { return transport_->writable(); } |
+ bool all_channels_writable() const { |
+ return transport_->all_channels_writable(); |
+ } |
void CheckRole(rtc::SSLRole role) { |
if (role == rtc::SSL_CLIENT) { |
@@ -374,8 +370,6 @@ class DtlsTestClient : public sigslot::has_slots<> { |
private: |
std::string name_; |
- rtc::Thread* signaling_thread_; |
- rtc::Thread* worker_thread_; |
cricket::TransportProtocol protocol_; |
rtc::scoped_ptr<rtc::SSLIdentity> identity_; |
rtc::scoped_ptr<cricket::FakeTransport> transport_; |
@@ -393,10 +387,8 @@ class DtlsTestClient : public sigslot::has_slots<> { |
class DtlsTransportChannelTest : public testing::Test { |
public: |
DtlsTransportChannelTest() : |
- client1_("P1", rtc::Thread::Current(), |
- rtc::Thread::Current()), |
- client2_("P2", rtc::Thread::Current(), |
- rtc::Thread::Current()), |
+ client1_("P1"), |
+ client2_("P2"), |
channel_ct_(1), |
use_dtls_(false), |
use_dtls_srtp_(false), |
@@ -443,8 +435,9 @@ class DtlsTransportChannelTest : public testing::Test { |
if (!rv) |
return false; |
- EXPECT_TRUE_WAIT(client1_.writable() && client2_.writable(), 10000); |
- if (!client1_.writable() || !client2_.writable()) |
+ EXPECT_TRUE_WAIT(client1_.all_channels_writable() && |
+ client2_.all_channels_writable(), 10000); |
+ if (!client1_.all_channels_writable() || !client2_.all_channels_writable()) |
return false; |
// Check that we used the right roles. |
@@ -844,7 +837,8 @@ TEST_F(DtlsTransportChannelTest, TestRenegotiateBeforeConnect) { |
cricket::CONNECTIONROLE_ACTIVE, NF_REOFFER); |
bool rv = client1_.Connect(&client2_); |
EXPECT_TRUE(rv); |
- EXPECT_TRUE_WAIT(client1_.writable() && client2_.writable(), 10000); |
+ EXPECT_TRUE_WAIT(client1_.all_channels_writable() && |
+ client2_.all_channels_writable(), 10000); |
TestTransfer(0, 1000, 100, true); |
TestTransfer(1, 1000, 100, true); |