Chromium Code Reviews| Index: talk/session/media/channel_unittest.cc |
| diff --git a/talk/session/media/channel_unittest.cc b/talk/session/media/channel_unittest.cc |
| index d6f25922ce9a88ecbad13560cdbe4365177b1ece..5496bf27bf18d13956060d9e69f06d867800ca12 100644 |
| --- a/talk/session/media/channel_unittest.cc |
| +++ b/talk/session/media/channel_unittest.cc |
| @@ -33,7 +33,8 @@ |
| #include "talk/media/base/rtpdump.h" |
| #include "talk/media/base/screencastid.h" |
| #include "talk/media/base/testutils.h" |
| -#include "webrtc/p2p/base/faketransportcontroller.h" |
| +#include "talk/media/webrtc/fakewebrtccall.h" |
| +#include "talk/app/webrtc/fakemediacontroller.h" |
| #include "talk/session/media/channel.h" |
| #include "webrtc/base/fileutils.h" |
| #include "webrtc/base/gunit.h" |
| @@ -44,6 +45,7 @@ |
| #include "webrtc/base/ssladapter.h" |
| #include "webrtc/base/sslidentity.h" |
| #include "webrtc/base/window.h" |
| +#include "webrtc/p2p/base/faketransportcontroller.h" |
| #define MAYBE_SKIP_TEST(feature) \ |
| if (!(rtc::SSLStreamAdapter::feature())) { \ |
| @@ -134,6 +136,8 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
| : verify_playout_(verify_playout), |
| transport_controller1_(cricket::ICEROLE_CONTROLLING), |
| transport_controller2_(cricket::ICEROLE_CONTROLLED), |
| + call_(webrtc::Call::Config()), |
| + media_controller_(&call_), |
| media_channel1_(NULL), |
| media_channel2_(NULL), |
| rtp_packet_(reinterpret_cast<const char*>(rtp_data), rtp_len), |
| @@ -152,10 +156,10 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
| media_channel1_ = ch1; |
| media_channel2_ = ch2; |
| channel1_.reset(CreateChannel(thread, &media_engine_, ch1, |
| - &transport_controller1_, |
| + &media_controller_, &transport_controller1_, |
| (flags1 & RTCP) != 0)); |
| channel2_.reset(CreateChannel(thread, &media_engine_, ch2, |
| - &transport_controller2_, |
| + &media_controller_, &transport_controller2_, |
| (flags2 & RTCP) != 0)); |
| channel1_->SignalMediaMonitor.connect( |
| this, &ChannelTest<T>::OnMediaMonitor); |
| @@ -205,10 +209,12 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
| rtc::Thread* thread, |
| cricket::MediaEngineInterface* engine, |
| typename T::MediaChannel* ch, |
| + webrtc::MediaControllerInterface* media_controller, |
| cricket::TransportController* transport_controller, |
| bool rtcp) { |
| - typename T::Channel* channel = new typename T::Channel( |
| - thread, engine, ch, transport_controller, cricket::CN_AUDIO, rtcp); |
| + typename T::Channel* channel = |
| + new typename T::Channel(thread, engine, ch, media_controller, |
| + transport_controller, cricket::CN_AUDIO, rtcp); |
| if (!channel->Init()) { |
| delete channel; |
| channel = NULL; |
| @@ -1789,6 +1795,8 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> { |
| cricket::FakeTransportController transport_controller1_; |
| cricket::FakeTransportController transport_controller2_; |
| cricket::FakeMediaEngine media_engine_; |
| + cricket::FakeCall call_; |
| + cricket::FakeMediaController media_controller_; |
| // The media channels are owned by the voice channel objects below. |
| typename T::MediaChannel* media_channel1_; |
| typename T::MediaChannel* media_channel2_; |
| @@ -1858,10 +1866,12 @@ cricket::VideoChannel* ChannelTest<VideoTraits>::CreateChannel( |
| rtc::Thread* thread, |
| cricket::MediaEngineInterface* engine, |
| cricket::FakeVideoMediaChannel* ch, |
| + webrtc::MediaControllerInterface* media_controller, |
| cricket::TransportController* transport_controller, |
| bool rtcp) { |
| - cricket::VideoChannel* channel = new cricket::VideoChannel( |
| - thread, ch, transport_controller, cricket::CN_VIDEO, rtcp); |
| + cricket::VideoChannel* channel = |
| + new cricket::VideoChannel(thread, ch, media_controller, |
| + transport_controller, cricket::CN_VIDEO, rtcp); |
| if (!channel->Init()) { |
| delete channel; |
| channel = NULL; |
| @@ -2530,6 +2540,11 @@ TEST_F(VideoChannelTest, TestOnReadyToSendWithRtcpMux) { |
| Base::TestOnReadyToSendWithRtcpMux(); |
| } |
| +TEST_F(VideoChannelTest, OnPacketSentIsCalled) { |
| + Base::SendRtpToRtp(); |
| + EXPECT_TRUE(call_.on_packet_sent_called()); |
|
pthatcher1
2015/10/05 18:30:13
Can we change this test to send a particular packe
|
| +} |
| + |
| TEST_F(VideoChannelTest, TestApplyViewRequest) { |
| CreateChannels(0, 0); |
| cricket::StreamParams stream2; |
| @@ -2612,6 +2627,7 @@ cricket::DataChannel* ChannelTest<DataTraits>::CreateChannel( |
| rtc::Thread* thread, |
| cricket::MediaEngineInterface* engine, |
| cricket::FakeDataMediaChannel* ch, |
| + webrtc::MediaControllerInterface* media_controller, |
| cricket::TransportController* transport_controller, |
| bool rtcp) { |
| cricket::DataChannel* channel = new cricket::DataChannel( |