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

Side by Side Diff: talk/session/media/channel_unittest.cc

Issue 1378513003: Change 'mute' parameter of MediaChannel::SetAudioSend()/SetVideoSend() to 'enable'. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « talk/session/media/channel.cc ('k') | talk/session/media/channelmanager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2009 Google Inc. 3 * Copyright 2009 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 1971
1972 TEST_F(VoiceChannelTest, TestPlayoutAndSendingStates) { 1972 TEST_F(VoiceChannelTest, TestPlayoutAndSendingStates) {
1973 Base::TestPlayoutAndSendingStates(); 1973 Base::TestPlayoutAndSendingStates();
1974 } 1974 }
1975 1975
1976 TEST_F(VoiceChannelTest, TestMuteStream) { 1976 TEST_F(VoiceChannelTest, TestMuteStream) {
1977 CreateChannels(0, 0); 1977 CreateChannels(0, 0);
1978 // Test that we can Mute the default channel even though the sending SSRC 1978 // Test that we can Mute the default channel even though the sending SSRC
1979 // is unknown. 1979 // is unknown.
1980 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 1980 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
1981 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr));
1982 EXPECT_TRUE(media_channel1_->IsStreamMuted(0));
1981 EXPECT_TRUE(channel1_->SetAudioSend(0, true, nullptr, nullptr)); 1983 EXPECT_TRUE(channel1_->SetAudioSend(0, true, nullptr, nullptr));
1982 EXPECT_TRUE(media_channel1_->IsStreamMuted(0));
1983 EXPECT_TRUE(channel1_->SetAudioSend(0, false, nullptr, nullptr));
1984 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 1984 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
1985 1985
1986 // Test that we can not mute an unknown SSRC. 1986 // Test that we can not mute an unknown SSRC.
1987 EXPECT_FALSE(channel1_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 1987 EXPECT_FALSE(channel1_->SetAudioSend(kSsrc1, false, nullptr, nullptr));
1988 1988
1989 SendInitiate(); 1989 SendInitiate();
1990 // After the local session description has been set, we can mute a stream 1990 // After the local session description has been set, we can mute a stream
1991 // with its SSRC. 1991 // with its SSRC.
1992 EXPECT_TRUE(channel1_->SetAudioSend(kSsrc1, false, nullptr, nullptr));
1993 EXPECT_TRUE(media_channel1_->IsStreamMuted(kSsrc1));
1992 EXPECT_TRUE(channel1_->SetAudioSend(kSsrc1, true, nullptr, nullptr)); 1994 EXPECT_TRUE(channel1_->SetAudioSend(kSsrc1, true, nullptr, nullptr));
1993 EXPECT_TRUE(media_channel1_->IsStreamMuted(kSsrc1));
1994 EXPECT_TRUE(channel1_->SetAudioSend(kSsrc1, false, nullptr, nullptr));
1995 EXPECT_FALSE(media_channel1_->IsStreamMuted(kSsrc1)); 1995 EXPECT_FALSE(media_channel1_->IsStreamMuted(kSsrc1));
1996 } 1996 }
1997 1997
1998 TEST_F(VoiceChannelTest, TestMediaContentDirection) { 1998 TEST_F(VoiceChannelTest, TestMediaContentDirection) {
1999 Base::TestMediaContentDirection(); 1999 Base::TestMediaContentDirection();
2000 } 2000 }
2001 2001
2002 TEST_F(VoiceChannelTest, TestCallSetup) { 2002 TEST_F(VoiceChannelTest, TestCallSetup) {
2003 Base::TestCallSetup(); 2003 Base::TestCallSetup();
2004 } 2004 }
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
2349 2349
2350 TEST_F(VideoChannelTest, TestPlayoutAndSendingStates) { 2350 TEST_F(VideoChannelTest, TestPlayoutAndSendingStates) {
2351 Base::TestPlayoutAndSendingStates(); 2351 Base::TestPlayoutAndSendingStates();
2352 } 2352 }
2353 2353
2354 TEST_F(VideoChannelTest, TestMuteStream) { 2354 TEST_F(VideoChannelTest, TestMuteStream) {
2355 CreateChannels(0, 0); 2355 CreateChannels(0, 0);
2356 // Test that we can Mute the default channel even though the sending SSRC 2356 // Test that we can Mute the default channel even though the sending SSRC
2357 // is unknown. 2357 // is unknown.
2358 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 2358 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
2359 EXPECT_TRUE(channel1_->SetVideoSend(0, false, nullptr));
2360 EXPECT_TRUE(media_channel1_->IsStreamMuted(0));
2359 EXPECT_TRUE(channel1_->SetVideoSend(0, true, nullptr)); 2361 EXPECT_TRUE(channel1_->SetVideoSend(0, true, nullptr));
2360 EXPECT_TRUE(media_channel1_->IsStreamMuted(0));
2361 EXPECT_TRUE(channel1_->SetVideoSend(0, false, nullptr));
2362 EXPECT_FALSE(media_channel1_->IsStreamMuted(0)); 2362 EXPECT_FALSE(media_channel1_->IsStreamMuted(0));
2363 // Test that we can not mute an unknown SSRC. 2363 // Test that we can not mute an unknown SSRC.
2364 EXPECT_FALSE(channel1_->SetVideoSend(kSsrc1, true, nullptr)); 2364 EXPECT_FALSE(channel1_->SetVideoSend(kSsrc1, false, nullptr));
2365 SendInitiate(); 2365 SendInitiate();
2366 // After the local session description has been set, we can mute a stream 2366 // After the local session description has been set, we can mute a stream
2367 // with its SSRC. 2367 // with its SSRC.
2368 EXPECT_TRUE(channel1_->SetVideoSend(kSsrc1, false, nullptr));
2369 EXPECT_TRUE(media_channel1_->IsStreamMuted(kSsrc1));
2368 EXPECT_TRUE(channel1_->SetVideoSend(kSsrc1, true, nullptr)); 2370 EXPECT_TRUE(channel1_->SetVideoSend(kSsrc1, true, nullptr));
2369 EXPECT_TRUE(media_channel1_->IsStreamMuted(kSsrc1));
2370 EXPECT_TRUE(channel1_->SetVideoSend(kSsrc1, false, nullptr));
2371 EXPECT_FALSE(media_channel1_->IsStreamMuted(kSsrc1)); 2371 EXPECT_FALSE(media_channel1_->IsStreamMuted(kSsrc1));
2372 } 2372 }
2373 2373
2374 TEST_F(VideoChannelTest, TestMediaContentDirection) { 2374 TEST_F(VideoChannelTest, TestMediaContentDirection) {
2375 Base::TestMediaContentDirection(); 2375 Base::TestMediaContentDirection();
2376 } 2376 }
2377 2377
2378 TEST_F(VideoChannelTest, TestCallSetup) { 2378 TEST_F(VideoChannelTest, TestCallSetup) {
2379 Base::TestCallSetup(); 2379 Base::TestCallSetup();
2380 } 2380 }
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
2802 }; 2802 };
2803 rtc::Buffer payload(data, 3); 2803 rtc::Buffer payload(data, 3);
2804 cricket::SendDataResult result; 2804 cricket::SendDataResult result;
2805 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); 2805 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result));
2806 EXPECT_EQ(params.ssrc, 2806 EXPECT_EQ(params.ssrc,
2807 media_channel1_->last_sent_data_params().ssrc); 2807 media_channel1_->last_sent_data_params().ssrc);
2808 EXPECT_EQ("foo", media_channel1_->last_sent_data()); 2808 EXPECT_EQ("foo", media_channel1_->last_sent_data());
2809 } 2809 }
2810 2810
2811 // TODO(pthatcher): TestSetReceiver? 2811 // TODO(pthatcher): TestSetReceiver?
OLDNEW
« no previous file with comments | « talk/session/media/channel.cc ('k') | talk/session/media/channelmanager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698