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 1642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1653 ASSERT_EQ(cricket::MD_INACTIVE, video_desc->direction()); | 1653 ASSERT_EQ(cricket::MD_INACTIVE, video_desc->direction()); |
1654 | 1654 |
1655 const cricket::ContentInfo* audio_content = | 1655 const cricket::ContentInfo* audio_content = |
1656 cricket::GetFirstAudioContent(offer->description()); | 1656 cricket::GetFirstAudioContent(offer->description()); |
1657 const cricket::AudioContentDescription* audio_desc = | 1657 const cricket::AudioContentDescription* audio_desc = |
1658 static_cast<const cricket::AudioContentDescription*>( | 1658 static_cast<const cricket::AudioContentDescription*>( |
1659 audio_content->description); | 1659 audio_content->description); |
1660 ASSERT_EQ(cricket::MD_INACTIVE, audio_desc->direction()); | 1660 ASSERT_EQ(cricket::MD_INACTIVE, audio_desc->direction()); |
1661 } | 1661 } |
1662 | 1662 |
| 1663 // Test that we can use SetConfiguration to change the ICE servers of the |
| 1664 // PortAllocator. |
| 1665 TEST_F(PeerConnectionInterfaceTest, SetConfigurationChangesIceServers) { |
| 1666 CreatePeerConnection(); |
| 1667 |
| 1668 PeerConnectionInterface::RTCConfiguration config; |
| 1669 PeerConnectionInterface::IceServer server; |
| 1670 server.uri = "stun:test_hostname"; |
| 1671 config.servers.push_back(server); |
| 1672 EXPECT_TRUE(pc_->SetConfiguration(config)); |
| 1673 |
| 1674 cricket::FakePortAllocator* allocator = |
| 1675 port_allocator_factory_->last_created_allocator(); |
| 1676 EXPECT_EQ(1u, allocator->stun_servers().size()); |
| 1677 EXPECT_EQ("test_hostname", allocator->stun_servers().begin()->hostname()); |
| 1678 } |
| 1679 |
1663 // Test that PeerConnection::Close changes the states to closed and all remote | 1680 // Test that PeerConnection::Close changes the states to closed and all remote |
1664 // tracks change state to ended. | 1681 // tracks change state to ended. |
1665 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { | 1682 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { |
1666 // Initialize a PeerConnection and negotiate local and remote session | 1683 // Initialize a PeerConnection and negotiate local and remote session |
1667 // description. | 1684 // description. |
1668 InitiateCall(); | 1685 InitiateCall(); |
1669 ASSERT_EQ(1u, pc_->local_streams()->count()); | 1686 ASSERT_EQ(1u, pc_->local_streams()->count()); |
1670 ASSERT_EQ(1u, pc_->remote_streams()->count()); | 1687 ASSERT_EQ(1u, pc_->remote_streams()->count()); |
1671 | 1688 |
1672 pc_->Close(); | 1689 pc_->Close(); |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2308 FakeConstraints updated_answer_c; | 2325 FakeConstraints updated_answer_c; |
2309 answer_c.SetMandatoryReceiveAudio(false); | 2326 answer_c.SetMandatoryReceiveAudio(false); |
2310 answer_c.SetMandatoryReceiveVideo(false); | 2327 answer_c.SetMandatoryReceiveVideo(false); |
2311 | 2328 |
2312 cricket::MediaSessionOptions updated_answer_options; | 2329 cricket::MediaSessionOptions updated_answer_options; |
2313 EXPECT_TRUE( | 2330 EXPECT_TRUE( |
2314 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2331 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2315 EXPECT_TRUE(updated_answer_options.has_audio()); | 2332 EXPECT_TRUE(updated_answer_options.has_audio()); |
2316 EXPECT_TRUE(updated_answer_options.has_video()); | 2333 EXPECT_TRUE(updated_answer_options.has_video()); |
2317 } | 2334 } |
OLD | NEW |