Stop QuicDataChannel and QuicDataTransport unit tests from segfaulting
Minor; needed because QuicTransportChannel now owns the ICE transport
channel as a result of the QuicTransport CL.
TBR=pthatcher@webrtc.org
BUG=
Review-Url: https://codereview.webrtc.org/1934723003
Cr-Commit-Position: refs/heads/master@{#12576}
diff --git a/webrtc/api/quicdatachannel_unittest.cc b/webrtc/api/quicdatachannel_unittest.cc
index 2dd9102..1c5fc02 100644
--- a/webrtc/api/quicdatachannel_unittest.cc
+++ b/webrtc/api/quicdatachannel_unittest.cc
@@ -167,9 +167,9 @@
class QuicDataChannelPeer {
public:
QuicDataChannelPeer()
- : ice_transport_channel_("data", 0),
- quic_transport_channel_(&ice_transport_channel_) {
- ice_transport_channel_.SetAsync(true);
+ : ice_transport_channel_(new FakeTransportChannel("data", 0)),
+ quic_transport_channel_(ice_transport_channel_) {
+ ice_transport_channel_->SetAsync(true);
fake_quic_data_transport_.ConnectToTransportChannel(
&quic_transport_channel_);
}
@@ -201,9 +201,9 @@
// Connects |ice_transport_channel_| to that of the other peer.
void Connect(QuicDataChannelPeer* other_peer) {
- ice_transport_channel_.Connect();
- other_peer->ice_transport_channel_.Connect();
- ice_transport_channel_.SetDestination(&other_peer->ice_transport_channel_);
+ ice_transport_channel_->Connect();
+ other_peer->ice_transport_channel_->Connect();
+ ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
}
rtc::scoped_ptr<rtc::SSLFingerprint>& local_fingerprint() {
@@ -215,11 +215,11 @@
}
FakeTransportChannel* ice_transport_channel() {
- return &ice_transport_channel_;
+ return ice_transport_channel_;
}
private:
- FakeTransportChannel ice_transport_channel_;
+ FakeTransportChannel* ice_transport_channel_;
QuicTransportChannel quic_transport_channel_;
rtc::scoped_ptr<rtc::SSLFingerprint> local_fingerprint_;
diff --git a/webrtc/api/quicdatatransport_unittest.cc b/webrtc/api/quicdatatransport_unittest.cc
index 312e825..ef9af36 100644
--- a/webrtc/api/quicdatatransport_unittest.cc
+++ b/webrtc/api/quicdatatransport_unittest.cc
@@ -64,9 +64,9 @@
public:
QuicDataTransportPeer()
: quic_data_transport_(rtc::Thread::Current(), rtc::Thread::Current()),
- ice_transport_channel_("data", 0),
- quic_transport_channel_(&ice_transport_channel_) {
- ice_transport_channel_.SetAsync(true);
+ ice_transport_channel_(new FakeTransportChannel("data", 0)),
+ quic_transport_channel_(ice_transport_channel_) {
+ ice_transport_channel_->SetAsync(true);
}
void GenerateCertificateAndFingerprint() {
@@ -79,9 +79,9 @@
// Connects |ice_transport_channel_| to that of the other peer.
void Connect(QuicDataTransportPeer* other_peer) {
- ice_transport_channel_.Connect();
- other_peer->ice_transport_channel_.Connect();
- ice_transport_channel_.SetDestination(&other_peer->ice_transport_channel_);
+ ice_transport_channel_->Connect();
+ other_peer->ice_transport_channel_->Connect();
+ ice_transport_channel_->SetDestination(other_peer->ice_transport_channel_);
}
rtc::scoped_ptr<rtc::SSLFingerprint>& local_fingerprint() {
@@ -122,7 +122,7 @@
}
QuicDataTransport quic_data_transport_;
- FakeTransportChannel ice_transport_channel_;
+ FakeTransportChannel* ice_transport_channel_;
QuicTransportChannel quic_transport_channel_;
rtc::scoped_ptr<rtc::SSLFingerprint> local_fingerprint_;
};