| OLD | NEW |
| 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 2073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2084 } | 2084 } |
| 2085 | 2085 |
| 2086 TEST_F(VoiceChannelTest, TestOnReadyToSend) { | 2086 TEST_F(VoiceChannelTest, TestOnReadyToSend) { |
| 2087 Base::TestOnReadyToSend(); | 2087 Base::TestOnReadyToSend(); |
| 2088 } | 2088 } |
| 2089 | 2089 |
| 2090 TEST_F(VoiceChannelTest, TestOnReadyToSendWithRtcpMux) { | 2090 TEST_F(VoiceChannelTest, TestOnReadyToSendWithRtcpMux) { |
| 2091 Base::TestOnReadyToSendWithRtcpMux(); | 2091 Base::TestOnReadyToSendWithRtcpMux(); |
| 2092 } | 2092 } |
| 2093 | 2093 |
| 2094 // Test that we can play a ringback tone properly. | |
| 2095 TEST_F(VoiceChannelTest, TestRingbackTone) { | |
| 2096 CreateChannels(RTCP, RTCP); | |
| 2097 EXPECT_FALSE(media_channel1_->ringback_tone_play()); | |
| 2098 EXPECT_TRUE(channel1_->SetRingbackTone("RIFF", 4)); | |
| 2099 EXPECT_TRUE(SendInitiate()); | |
| 2100 EXPECT_TRUE(SendAccept()); | |
| 2101 // Play ringback tone, no loop. | |
| 2102 EXPECT_TRUE(channel1_->PlayRingbackTone(0, true, false)); | |
| 2103 EXPECT_EQ(0U, media_channel1_->ringback_tone_ssrc()); | |
| 2104 EXPECT_TRUE(media_channel1_->ringback_tone_play()); | |
| 2105 EXPECT_FALSE(media_channel1_->ringback_tone_loop()); | |
| 2106 // Stop the ringback tone. | |
| 2107 EXPECT_TRUE(channel1_->PlayRingbackTone(0, false, false)); | |
| 2108 EXPECT_FALSE(media_channel1_->ringback_tone_play()); | |
| 2109 // Add a stream. | |
| 2110 EXPECT_TRUE(AddStream1(1)); | |
| 2111 // Play ringback tone, looping, on the new stream. | |
| 2112 EXPECT_TRUE(channel1_->PlayRingbackTone(1, true, true)); | |
| 2113 EXPECT_EQ(1U, media_channel1_->ringback_tone_ssrc()); | |
| 2114 EXPECT_TRUE(media_channel1_->ringback_tone_play()); | |
| 2115 EXPECT_TRUE(media_channel1_->ringback_tone_loop()); | |
| 2116 // Stop the ringback tone. | |
| 2117 EXPECT_TRUE(channel1_->PlayRingbackTone(1, false, false)); | |
| 2118 EXPECT_FALSE(media_channel1_->ringback_tone_play()); | |
| 2119 } | |
| 2120 | |
| 2121 // Test that we can scale the output volume properly for 1:1 calls. | 2094 // Test that we can scale the output volume properly for 1:1 calls. |
| 2122 TEST_F(VoiceChannelTest, TestScaleVolume1to1Call) { | 2095 TEST_F(VoiceChannelTest, TestScaleVolume1to1Call) { |
| 2123 CreateChannels(RTCP, RTCP); | 2096 CreateChannels(RTCP, RTCP); |
| 2124 EXPECT_TRUE(SendInitiate()); | 2097 EXPECT_TRUE(SendInitiate()); |
| 2125 EXPECT_TRUE(SendAccept()); | 2098 EXPECT_TRUE(SendAccept()); |
| 2126 double left, right; | 2099 double left, right; |
| 2127 | 2100 |
| 2128 // Default is (1.0, 1.0). | 2101 // Default is (1.0, 1.0). |
| 2129 EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right)); | 2102 EXPECT_TRUE(media_channel1_->GetOutputScaling(0, &left, &right)); |
| 2130 EXPECT_DOUBLE_EQ(1.0, left); | 2103 EXPECT_DOUBLE_EQ(1.0, left); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2731 }; | 2704 }; |
| 2732 rtc::Buffer payload(data, 3); | 2705 rtc::Buffer payload(data, 3); |
| 2733 cricket::SendDataResult result; | 2706 cricket::SendDataResult result; |
| 2734 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); | 2707 ASSERT_TRUE(media_channel1_->SendData(params, payload, &result)); |
| 2735 EXPECT_EQ(params.ssrc, | 2708 EXPECT_EQ(params.ssrc, |
| 2736 media_channel1_->last_sent_data_params().ssrc); | 2709 media_channel1_->last_sent_data_params().ssrc); |
| 2737 EXPECT_EQ("foo", media_channel1_->last_sent_data()); | 2710 EXPECT_EQ("foo", media_channel1_->last_sent_data()); |
| 2738 } | 2711 } |
| 2739 | 2712 |
| 2740 // TODO(pthatcher): TestSetReceiver? | 2713 // TODO(pthatcher): TestSetReceiver? |
| OLD | NEW |