| OLD | NEW |
| 1 /* | 1 /* |
| 2 * libjingle | 2 * libjingle |
| 3 * Copyright 2012 Google Inc. | 3 * Copyright 2012 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 3090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3101 } | 3101 } |
| 3102 | 3102 |
| 3103 TEST_F(WebRtcSessionTest, SetAudioPlayout) { | 3103 TEST_F(WebRtcSessionTest, SetAudioPlayout) { |
| 3104 Init(); | 3104 Init(); |
| 3105 mediastream_signaling_.SendAudioVideoStream1(); | 3105 mediastream_signaling_.SendAudioVideoStream1(); |
| 3106 CreateAndSetRemoteOfferAndLocalAnswer(); | 3106 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3107 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); | 3107 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); |
| 3108 ASSERT_TRUE(channel != NULL); | 3108 ASSERT_TRUE(channel != NULL); |
| 3109 ASSERT_EQ(1u, channel->recv_streams().size()); | 3109 ASSERT_EQ(1u, channel->recv_streams().size()); |
| 3110 uint32_t receive_ssrc = channel->recv_streams()[0].first_ssrc(); | 3110 uint32_t receive_ssrc = channel->recv_streams()[0].first_ssrc(); |
| 3111 double left_vol, right_vol; | 3111 double volume; |
| 3112 EXPECT_TRUE(channel->GetOutputScaling(receive_ssrc, &left_vol, &right_vol)); | 3112 EXPECT_TRUE(channel->GetOutputVolume(receive_ssrc, &volume)); |
| 3113 EXPECT_EQ(1, left_vol); | 3113 EXPECT_EQ(1, volume); |
| 3114 EXPECT_EQ(1, right_vol); | |
| 3115 rtc::scoped_ptr<FakeAudioRenderer> renderer(new FakeAudioRenderer()); | 3114 rtc::scoped_ptr<FakeAudioRenderer> renderer(new FakeAudioRenderer()); |
| 3116 session_->SetAudioPlayout(receive_ssrc, false, renderer.get()); | 3115 session_->SetAudioPlayout(receive_ssrc, false, renderer.get()); |
| 3117 EXPECT_TRUE(channel->GetOutputScaling(receive_ssrc, &left_vol, &right_vol)); | 3116 EXPECT_TRUE(channel->GetOutputVolume(receive_ssrc, &volume)); |
| 3118 EXPECT_EQ(0, left_vol); | 3117 EXPECT_EQ(0, volume); |
| 3119 EXPECT_EQ(0, right_vol); | |
| 3120 EXPECT_EQ(0, renderer->channel_id()); | 3118 EXPECT_EQ(0, renderer->channel_id()); |
| 3121 session_->SetAudioPlayout(receive_ssrc, true, NULL); | 3119 session_->SetAudioPlayout(receive_ssrc, true, NULL); |
| 3122 EXPECT_TRUE(channel->GetOutputScaling(receive_ssrc, &left_vol, &right_vol)); | 3120 EXPECT_TRUE(channel->GetOutputVolume(receive_ssrc, &volume)); |
| 3123 EXPECT_EQ(1, left_vol); | 3121 EXPECT_EQ(1, volume); |
| 3124 EXPECT_EQ(1, right_vol); | |
| 3125 EXPECT_EQ(-1, renderer->channel_id()); | 3122 EXPECT_EQ(-1, renderer->channel_id()); |
| 3126 } | 3123 } |
| 3127 | 3124 |
| 3128 TEST_F(WebRtcSessionTest, SetAudioSend) { | 3125 TEST_F(WebRtcSessionTest, SetAudioSend) { |
| 3129 Init(); | 3126 Init(); |
| 3130 mediastream_signaling_.SendAudioVideoStream1(); | 3127 mediastream_signaling_.SendAudioVideoStream1(); |
| 3131 CreateAndSetRemoteOfferAndLocalAnswer(); | 3128 CreateAndSetRemoteOfferAndLocalAnswer(); |
| 3132 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); | 3129 cricket::FakeVoiceMediaChannel* channel = media_engine_->GetVoiceChannel(0); |
| 3133 ASSERT_TRUE(channel != NULL); | 3130 ASSERT_TRUE(channel != NULL); |
| 3134 ASSERT_EQ(1u, channel->send_streams().size()); | 3131 ASSERT_EQ(1u, channel->send_streams().size()); |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4033 } | 4030 } |
| 4034 | 4031 |
| 4035 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test | 4032 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test |
| 4036 // currently fails because upon disconnection and reconnection OnIceComplete is | 4033 // currently fails because upon disconnection and reconnection OnIceComplete is |
| 4037 // called more than once without returning to IceGatheringGathering. | 4034 // called more than once without returning to IceGatheringGathering. |
| 4038 | 4035 |
| 4039 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, | 4036 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, |
| 4040 WebRtcSessionTest, | 4037 WebRtcSessionTest, |
| 4041 testing::Values(ALREADY_GENERATED, | 4038 testing::Values(ALREADY_GENERATED, |
| 4042 DTLS_IDENTITY_STORE)); | 4039 DTLS_IDENTITY_STORE)); |
| OLD | NEW |