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

Unified Diff: talk/session/media/channel_unittest.cc

Issue 1334793003: Remove VideoMediaChannel::SetRender(). (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove IsReadyToReceive from logging Created 5 years, 3 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
« no previous file with comments | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: talk/session/media/channel_unittest.cc
diff --git a/talk/session/media/channel_unittest.cc b/talk/session/media/channel_unittest.cc
index d6e259d31e58e0fbc8932a179639269f9d1ac7b5..70e68f385b888afa4c83588166bf6f2d3d8d4f93 100644
--- a/talk/session/media/channel_unittest.cc
+++ b/talk/session/media/channel_unittest.cc
@@ -126,11 +126,13 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
enum Flags { RTCP = 0x1, RTCP_MUX = 0x2, SECURE = 0x4, SSRC_MUX = 0x8,
DTLS = 0x10 };
- ChannelTest(const uint8* rtp_data,
+ ChannelTest(bool verify_playout,
+ const uint8* rtp_data,
int rtp_len,
const uint8* rtcp_data,
int rtcp_len)
- : transport_controller1_(cricket::ICEROLE_CONTROLLING),
+ : verify_playout_(verify_playout),
+ transport_controller1_(cricket::ICEROLE_CONTROLLING),
transport_controller2_(cricket::ICEROLE_CONTROLLED),
media_channel1_(NULL),
media_channel2_(NULL),
@@ -489,7 +491,8 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
CreateChannels(0, 0);
EXPECT_FALSE(channel1_->secure());
EXPECT_FALSE(media_channel1_->sending());
- EXPECT_FALSE(media_channel1_->playout());
+ if (verify_playout_)
pthatcher1 2015/09/24 16:46:52 {}s
pbos-webrtc 2015/09/24 16:53:44 Done, woo!
+ EXPECT_FALSE(media_channel1_->playout());
EXPECT_TRUE(media_channel1_->codecs().empty());
EXPECT_TRUE(media_channel1_->recv_streams().empty());
EXPECT_TRUE(media_channel1_->rtp_packets().empty());
@@ -816,36 +819,46 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
// Test that we only start playout and sending at the right times.
void TestPlayoutAndSendingStates() {
CreateChannels(0, 0);
- EXPECT_FALSE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
- EXPECT_FALSE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout());
EXPECT_FALSE(media_channel2_->sending());
EXPECT_TRUE(channel1_->Enable(true));
- EXPECT_FALSE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
EXPECT_TRUE(channel1_->SetLocalContent(&local_media_content1_,
CA_OFFER, NULL));
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
EXPECT_TRUE(channel2_->SetRemoteContent(&local_media_content1_,
CA_OFFER, NULL));
- EXPECT_FALSE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout());
EXPECT_FALSE(media_channel2_->sending());
EXPECT_TRUE(channel2_->SetLocalContent(&local_media_content2_,
CA_ANSWER, NULL));
- EXPECT_FALSE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout());
EXPECT_FALSE(media_channel2_->sending());
transport_controller1_.Connect(&transport_controller2_);
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
- EXPECT_FALSE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout());
EXPECT_FALSE(media_channel2_->sending());
EXPECT_TRUE(channel2_->Enable(true));
- EXPECT_TRUE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel2_->playout());
EXPECT_TRUE(media_channel2_->sending());
EXPECT_TRUE(channel1_->SetRemoteContent(&local_media_content2_,
CA_ANSWER, NULL));
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_TRUE(media_channel1_->sending());
}
@@ -862,9 +875,11 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_TRUE(channel1_->Enable(true));
EXPECT_TRUE(channel2_->Enable(true));
- EXPECT_FALSE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
- EXPECT_FALSE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout());
EXPECT_FALSE(media_channel2_->sending());
EXPECT_TRUE(channel1_->SetLocalContent(&content1, CA_OFFER, NULL));
@@ -873,9 +888,11 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
transport_controller1_.Connect(&transport_controller2_);
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending()); // remote InActive
- EXPECT_FALSE(media_channel2_->playout()); // local InActive
+ if (verify_playout_)
+ EXPECT_FALSE(media_channel2_->playout()); // local InActive
EXPECT_FALSE(media_channel2_->sending()); // local InActive
// Update |content2| to be RecvOnly.
@@ -883,9 +900,11 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_PRANSWER, NULL));
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_PRANSWER, NULL));
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_TRUE(media_channel1_->sending());
- EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel2_->playout()); // local RecvOnly
EXPECT_FALSE(media_channel2_->sending()); // local RecvOnly
// Update |content2| to be SendRecv.
@@ -893,9 +912,11 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
EXPECT_TRUE(channel2_->SetLocalContent(&content2, CA_ANSWER, NULL));
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, CA_ANSWER, NULL));
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_TRUE(media_channel1_->sending());
- EXPECT_TRUE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel2_->playout());
EXPECT_TRUE(media_channel2_->sending());
}
@@ -904,13 +925,15 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
CreateChannels(0, 0);
EXPECT_FALSE(channel1_->secure());
EXPECT_TRUE(SendInitiate());
- EXPECT_TRUE(media_channel1_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel1_->playout());
EXPECT_FALSE(media_channel1_->sending());
EXPECT_TRUE(SendAccept());
EXPECT_FALSE(channel1_->secure());
EXPECT_TRUE(media_channel1_->sending());
EXPECT_EQ(1U, media_channel1_->codecs().size());
- EXPECT_TRUE(media_channel2_->playout());
+ if (verify_playout_)
+ EXPECT_TRUE(media_channel2_->playout());
EXPECT_TRUE(media_channel2_->sending());
EXPECT_EQ(1U, media_channel2_->codecs().size());
}
@@ -1738,6 +1761,9 @@ class ChannelTest : public testing::Test, public sigslot::has_slots<> {
}
protected:
+ // TODO(pbos): Remove playout from media engines, muting should be controlled
+ // by the renderer.
+ const bool verify_playout_;
cricket::FakeTransportController transport_controller1_;
cricket::FakeTransportController transport_controller2_;
cricket::FakeMediaEngine media_engine_;
@@ -1801,8 +1827,11 @@ class VoiceChannelTest
public:
typedef ChannelTest<VoiceTraits> Base;
VoiceChannelTest()
- : Base(kPcmuFrame, sizeof(kPcmuFrame), kRtcpReport, sizeof(kRtcpReport)) {
- }
+ : Base(true,
+ kPcmuFrame,
+ sizeof(kPcmuFrame),
+ kRtcpReport,
+ sizeof(kRtcpReport)) {}
};
// override to add NULL parameter
@@ -1868,7 +1897,8 @@ class VideoChannelTest
public:
typedef ChannelTest<VideoTraits> Base;
VideoChannelTest()
- : Base(kH264Packet,
+ : Base(false,
+ kH264Packet,
sizeof(kH264Packet),
kRtcpReport,
sizeof(kRtcpReport)) {}
@@ -2556,9 +2586,12 @@ class DataChannelTest
public:
typedef ChannelTest<DataTraits>
Base;
- DataChannelTest() : Base(kDataPacket, sizeof(kDataPacket),
- kRtcpReport, sizeof(kRtcpReport)) {
- }
+ DataChannelTest()
+ : Base(true,
+ kDataPacket,
+ sizeof(kDataPacket),
+ kRtcpReport,
+ sizeof(kRtcpReport)) {}
};
// Override to avoid engine channel parameter.
« no previous file with comments | « talk/session/media/channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698