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 1554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 EXPECT_TRUE(DoSetSessionDescription(answer, false)); | 1565 EXPECT_TRUE(DoSetSessionDescription(answer, false)); |
1566 | 1566 |
1567 SessionDescriptionInterface* updated_offer = | 1567 SessionDescriptionInterface* updated_offer = |
1568 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, | 1568 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, |
1569 webrtc::kAudioSdpWithUnsupportedCodecs, | 1569 webrtc::kAudioSdpWithUnsupportedCodecs, |
1570 nullptr); | 1570 nullptr); |
1571 EXPECT_TRUE(DoSetSessionDescription(updated_offer, false)); | 1571 EXPECT_TRUE(DoSetSessionDescription(updated_offer, false)); |
1572 CreateAnswerAsLocalDescription(); | 1572 CreateAnswerAsLocalDescription(); |
1573 } | 1573 } |
1574 | 1574 |
| 1575 // Test that we can use SetConfiguration to change the ICE servers of the |
| 1576 // PortAllocator. |
| 1577 TEST_F(PeerConnectionInterfaceTest, SetConfigurationChangesIceServers) { |
| 1578 CreatePeerConnection(); |
| 1579 |
| 1580 PeerConnectionInterface::RTCConfiguration config; |
| 1581 PeerConnectionInterface::IceServer server; |
| 1582 server.uri = "stun:test_hostname"; |
| 1583 config.servers.push_back(server); |
| 1584 EXPECT_TRUE(pc_->SetConfiguration(config)); |
| 1585 |
| 1586 cricket::FakePortAllocator* allocator = |
| 1587 port_allocator_factory_->last_created_allocator(); |
| 1588 EXPECT_EQ(1u, allocator->stun_servers().size()); |
| 1589 EXPECT_EQ("test_hostname", allocator->stun_servers().begin()->hostname()); |
| 1590 } |
| 1591 |
1575 // Test that PeerConnection::Close changes the states to closed and all remote | 1592 // Test that PeerConnection::Close changes the states to closed and all remote |
1576 // tracks change state to ended. | 1593 // tracks change state to ended. |
1577 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { | 1594 TEST_F(PeerConnectionInterfaceTest, CloseAndTestStreamsAndStates) { |
1578 // Initialize a PeerConnection and negotiate local and remote session | 1595 // Initialize a PeerConnection and negotiate local and remote session |
1579 // description. | 1596 // description. |
1580 InitiateCall(); | 1597 InitiateCall(); |
1581 ASSERT_EQ(1u, pc_->local_streams()->count()); | 1598 ASSERT_EQ(1u, pc_->local_streams()->count()); |
1582 ASSERT_EQ(1u, pc_->remote_streams()->count()); | 1599 ASSERT_EQ(1u, pc_->remote_streams()->count()); |
1583 | 1600 |
1584 pc_->Close(); | 1601 pc_->Close(); |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2209 EXPECT_TRUE(updated_answer_options.has_video()); | 2226 EXPECT_TRUE(updated_answer_options.has_video()); |
2210 | 2227 |
2211 RTCOfferAnswerOptions default_rtc_options; | 2228 RTCOfferAnswerOptions default_rtc_options; |
2212 EXPECT_TRUE( | 2229 EXPECT_TRUE( |
2213 ConvertRtcOptionsForOffer(default_rtc_options, &updated_offer_options)); | 2230 ConvertRtcOptionsForOffer(default_rtc_options, &updated_offer_options)); |
2214 // By default, |has_audio| or |has_video| are false if there is no media | 2231 // By default, |has_audio| or |has_video| are false if there is no media |
2215 // track. | 2232 // track. |
2216 EXPECT_FALSE(updated_offer_options.has_audio()); | 2233 EXPECT_FALSE(updated_offer_options.has_audio()); |
2217 EXPECT_FALSE(updated_offer_options.has_video()); | 2234 EXPECT_FALSE(updated_offer_options.has_video()); |
2218 } | 2235 } |
OLD | NEW |