OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 1683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1694 SessionDescriptionInterface::kAnswer); | 1694 SessionDescriptionInterface::kAnswer); |
1695 EXPECT_TRUE(answer->Initialize(sdp, NULL)); | 1695 EXPECT_TRUE(answer->Initialize(sdp, NULL)); |
1696 cricket::ContentInfo* data_info = | 1696 cricket::ContentInfo* data_info = |
1697 answer->description()->GetContentByName("data"); | 1697 answer->description()->GetContentByName("data"); |
1698 data_info->rejected = true; | 1698 data_info->rejected = true; |
1699 | 1699 |
1700 DoSetRemoteDescription(answer); | 1700 DoSetRemoteDescription(answer); |
1701 EXPECT_EQ(DataChannelInterface::kClosed, offer_channel->state()); | 1701 EXPECT_EQ(DataChannelInterface::kClosed, offer_channel->state()); |
1702 } | 1702 } |
1703 | 1703 |
1704 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
1705 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
1706 #define MAYBE_ReceiveFireFoxOffer DISABLED_ReceiveFireFoxOffer | |
1707 #else | |
1708 #define MAYBE_ReceiveFireFoxOffer ReceiveFireFoxOffer | |
1709 #endif | |
1710 // Test that we can create a session description from an SDP string from | 1704 // Test that we can create a session description from an SDP string from |
1711 // FireFox, use it as a remote session description, generate an answer and use | 1705 // FireFox, use it as a remote session description, generate an answer and use |
1712 // the answer as a local description. | 1706 // the answer as a local description. |
1713 TEST_F(PeerConnectionInterfaceTest, MAYBE_ReceiveFireFoxOffer) { | 1707 TEST_F(PeerConnectionInterfaceTest, ReceiveFireFoxOffer) { |
1714 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); | 1708 MAYBE_SKIP_TEST(rtc::SSLStreamAdapter::HaveDtlsSrtp); |
1715 FakeConstraints constraints; | 1709 FakeConstraints constraints; |
1716 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 1710 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
1717 true); | 1711 true); |
1718 CreatePeerConnection(&constraints); | 1712 CreatePeerConnection(&constraints); |
1719 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); | 1713 AddAudioVideoStream(kStreamLabel1, "audio_label", "video_label"); |
1720 SessionDescriptionInterface* desc = | 1714 SessionDescriptionInterface* desc = |
1721 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, | 1715 webrtc::CreateSessionDescription(SessionDescriptionInterface::kOffer, |
1722 webrtc::kFireFoxSdpOffer, nullptr); | 1716 webrtc::kFireFoxSdpOffer, nullptr); |
1723 EXPECT_TRUE(DoSetSessionDescription(desc, false)); | 1717 EXPECT_TRUE(DoSetSessionDescription(desc, false)); |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2087 CreatePeerConnection(&constraints); | 2081 CreatePeerConnection(&constraints); |
2088 | 2082 |
2089 std::string recvonly_offer = kSdpStringWithStream1; | 2083 std::string recvonly_offer = kSdpStringWithStream1; |
2090 rtc::replace_substrs(kSendrecv, strlen(kSendrecv), kRecvonly, | 2084 rtc::replace_substrs(kSendrecv, strlen(kSendrecv), kRecvonly, |
2091 strlen(kRecvonly), &recvonly_offer); | 2085 strlen(kRecvonly), &recvonly_offer); |
2092 CreateAndSetRemoteOffer(recvonly_offer); | 2086 CreateAndSetRemoteOffer(recvonly_offer); |
2093 | 2087 |
2094 EXPECT_EQ(0u, observer_.remote_streams()->count()); | 2088 EXPECT_EQ(0u, observer_.remote_streams()->count()); |
2095 } | 2089 } |
2096 | 2090 |
2097 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2098 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2099 #define MAYBE_SdpWithoutMsidCreatesDefaultStream \ | |
2100 DISABLED_SdpWithoutMsidCreatesDefaultStream | |
2101 #else | |
2102 #define MAYBE_SdpWithoutMsidCreatesDefaultStream \ | |
2103 SdpWithoutMsidCreatesDefaultStream | |
2104 #endif | |
2105 // This tests that a default MediaStream is created if a remote session | 2091 // This tests that a default MediaStream is created if a remote session |
2106 // description doesn't contain any streams and no MSID support. | 2092 // description doesn't contain any streams and no MSID support. |
2107 // It also tests that the default stream is updated if a video m-line is added | 2093 // It also tests that the default stream is updated if a video m-line is added |
2108 // in a subsequent session description. | 2094 // in a subsequent session description. |
2109 TEST_F(PeerConnectionInterfaceTest, MAYBE_SdpWithoutMsidCreatesDefaultStream) { | 2095 TEST_F(PeerConnectionInterfaceTest, SdpWithoutMsidCreatesDefaultStream) { |
2110 FakeConstraints constraints; | 2096 FakeConstraints constraints; |
2111 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2097 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2112 true); | 2098 true); |
2113 CreatePeerConnection(&constraints); | 2099 CreatePeerConnection(&constraints); |
2114 CreateAndSetRemoteOffer(kSdpStringWithoutStreamsAudioOnly); | 2100 CreateAndSetRemoteOffer(kSdpStringWithoutStreamsAudioOnly); |
2115 | 2101 |
2116 ASSERT_EQ(1u, observer_.remote_streams()->count()); | 2102 ASSERT_EQ(1u, observer_.remote_streams()->count()); |
2117 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); | 2103 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); |
2118 | 2104 |
2119 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); | 2105 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); |
2120 EXPECT_EQ(0u, remote_stream->GetVideoTracks().size()); | 2106 EXPECT_EQ(0u, remote_stream->GetVideoTracks().size()); |
2121 EXPECT_EQ("default", remote_stream->label()); | 2107 EXPECT_EQ("default", remote_stream->label()); |
2122 | 2108 |
2123 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); | 2109 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); |
2124 ASSERT_EQ(1u, observer_.remote_streams()->count()); | 2110 ASSERT_EQ(1u, observer_.remote_streams()->count()); |
2125 ASSERT_EQ(1u, remote_stream->GetAudioTracks().size()); | 2111 ASSERT_EQ(1u, remote_stream->GetAudioTracks().size()); |
2126 EXPECT_EQ("defaulta0", remote_stream->GetAudioTracks()[0]->id()); | 2112 EXPECT_EQ("defaulta0", remote_stream->GetAudioTracks()[0]->id()); |
2127 EXPECT_EQ(MediaStreamTrackInterface::kLive, | 2113 EXPECT_EQ(MediaStreamTrackInterface::kLive, |
2128 remote_stream->GetAudioTracks()[0]->state()); | 2114 remote_stream->GetAudioTracks()[0]->state()); |
2129 ASSERT_EQ(1u, remote_stream->GetVideoTracks().size()); | 2115 ASSERT_EQ(1u, remote_stream->GetVideoTracks().size()); |
2130 EXPECT_EQ("defaultv0", remote_stream->GetVideoTracks()[0]->id()); | 2116 EXPECT_EQ("defaultv0", remote_stream->GetVideoTracks()[0]->id()); |
2131 EXPECT_EQ(MediaStreamTrackInterface::kLive, | 2117 EXPECT_EQ(MediaStreamTrackInterface::kLive, |
2132 remote_stream->GetVideoTracks()[0]->state()); | 2118 remote_stream->GetVideoTracks()[0]->state()); |
2133 } | 2119 } |
2134 | 2120 |
2135 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2136 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2137 #define MAYBE_SendOnlySdpWithoutMsidCreatesDefaultStream \ | |
2138 DISABLED_SendOnlySdpWithoutMsidCreatesDefaultStream | |
2139 #else | |
2140 #define MAYBE_SendOnlySdpWithoutMsidCreatesDefaultStream \ | |
2141 SendOnlySdpWithoutMsidCreatesDefaultStream | |
2142 #endif | |
2143 // This tests that a default MediaStream is created if a remote session | 2121 // This tests that a default MediaStream is created if a remote session |
2144 // description doesn't contain any streams and media direction is send only. | 2122 // description doesn't contain any streams and media direction is send only. |
2145 TEST_F(PeerConnectionInterfaceTest, | 2123 TEST_F(PeerConnectionInterfaceTest, |
2146 MAYBE_SendOnlySdpWithoutMsidCreatesDefaultStream) { | 2124 SendOnlySdpWithoutMsidCreatesDefaultStream) { |
2147 FakeConstraints constraints; | 2125 FakeConstraints constraints; |
2148 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2126 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2149 true); | 2127 true); |
2150 CreatePeerConnection(&constraints); | 2128 CreatePeerConnection(&constraints); |
2151 CreateAndSetRemoteOffer(kSdpStringSendOnlyWithoutStreams); | 2129 CreateAndSetRemoteOffer(kSdpStringSendOnlyWithoutStreams); |
2152 | 2130 |
2153 ASSERT_EQ(1u, observer_.remote_streams()->count()); | 2131 ASSERT_EQ(1u, observer_.remote_streams()->count()); |
2154 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); | 2132 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); |
2155 | 2133 |
2156 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); | 2134 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); |
(...skipping 11 matching lines...) Expand all Loading... |
2168 CreateAndSetRemoteOffer(kSdpStringWithStream1); | 2146 CreateAndSetRemoteOffer(kSdpStringWithStream1); |
2169 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); | 2147 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); |
2170 remote_stream->RemoveTrack(remote_stream->GetAudioTracks()[0]); | 2148 remote_stream->RemoveTrack(remote_stream->GetAudioTracks()[0]); |
2171 remote_stream->RemoveTrack(remote_stream->GetVideoTracks()[0]); | 2149 remote_stream->RemoveTrack(remote_stream->GetVideoTracks()[0]); |
2172 | 2150 |
2173 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); | 2151 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); |
2174 | 2152 |
2175 // No crash is a pass. | 2153 // No crash is a pass. |
2176 } | 2154 } |
2177 | 2155 |
2178 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2179 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2180 #define MAYBE_SdpWithoutMsidAndStreamsCreatesDefaultStream \ | |
2181 DISABLED_SdpWithoutMsidAndStreamsCreatesDefaultStream | |
2182 #else | |
2183 #define MAYBE_SdpWithoutMsidAndStreamsCreatesDefaultStream \ | |
2184 SdpWithoutMsidAndStreamsCreatesDefaultStream | |
2185 #endif | |
2186 // This tests that a default MediaStream is created if the remote session | 2156 // This tests that a default MediaStream is created if the remote session |
2187 // description doesn't contain any streams and don't contain an indication if | 2157 // description doesn't contain any streams and don't contain an indication if |
2188 // MSID is supported. | 2158 // MSID is supported. |
2189 TEST_F(PeerConnectionInterfaceTest, | 2159 TEST_F(PeerConnectionInterfaceTest, |
2190 MAYBE_SdpWithoutMsidAndStreamsCreatesDefaultStream) { | 2160 SdpWithoutMsidAndStreamsCreatesDefaultStream) { |
2191 FakeConstraints constraints; | 2161 FakeConstraints constraints; |
2192 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2162 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2193 true); | 2163 true); |
2194 CreatePeerConnection(&constraints); | 2164 CreatePeerConnection(&constraints); |
2195 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); | 2165 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); |
2196 | 2166 |
2197 ASSERT_EQ(1u, observer_.remote_streams()->count()); | 2167 ASSERT_EQ(1u, observer_.remote_streams()->count()); |
2198 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); | 2168 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); |
2199 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); | 2169 EXPECT_EQ(1u, remote_stream->GetAudioTracks().size()); |
2200 EXPECT_EQ(1u, remote_stream->GetVideoTracks().size()); | 2170 EXPECT_EQ(1u, remote_stream->GetVideoTracks().size()); |
2201 } | 2171 } |
2202 | 2172 |
2203 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2204 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2205 #define MAYBE_SdpWithMsidDontCreatesDefaultStream \ | |
2206 DISABLED_SdpWithMsidDontCreatesDefaultStream | |
2207 #else | |
2208 #define MAYBE_SdpWithMsidDontCreatesDefaultStream \ | |
2209 SdpWithMsidDontCreatesDefaultStream | |
2210 #endif | |
2211 // This tests that a default MediaStream is not created if the remote session | 2173 // This tests that a default MediaStream is not created if the remote session |
2212 // description doesn't contain any streams but does support MSID. | 2174 // description doesn't contain any streams but does support MSID. |
2213 TEST_F(PeerConnectionInterfaceTest, MAYBE_SdpWithMsidDontCreatesDefaultStream) { | 2175 TEST_F(PeerConnectionInterfaceTest, SdpWithMsidDontCreatesDefaultStream) { |
2214 FakeConstraints constraints; | 2176 FakeConstraints constraints; |
2215 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2177 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2216 true); | 2178 true); |
2217 CreatePeerConnection(&constraints); | 2179 CreatePeerConnection(&constraints); |
2218 CreateAndSetRemoteOffer(kSdpStringWithMsidWithoutStreams); | 2180 CreateAndSetRemoteOffer(kSdpStringWithMsidWithoutStreams); |
2219 EXPECT_EQ(0u, observer_.remote_streams()->count()); | 2181 EXPECT_EQ(0u, observer_.remote_streams()->count()); |
2220 } | 2182 } |
2221 | 2183 |
2222 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2223 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2224 #define MAYBE_DefaultTracksNotDestroyedAndRecreated \ | |
2225 DISABLED_DefaultTracksNotDestroyedAndRecreated | |
2226 #else | |
2227 #define MAYBE_DefaultTracksNotDestroyedAndRecreated \ | |
2228 DefaultTracksNotDestroyedAndRecreated | |
2229 #endif | |
2230 // This tests that when setting a new description, the old default tracks are | 2184 // This tests that when setting a new description, the old default tracks are |
2231 // not destroyed and recreated. | 2185 // not destroyed and recreated. |
2232 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=5250 | 2186 // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=5250 |
2233 TEST_F(PeerConnectionInterfaceTest, | 2187 TEST_F(PeerConnectionInterfaceTest, |
2234 MAYBE_DefaultTracksNotDestroyedAndRecreated) { | 2188 DefaultTracksNotDestroyedAndRecreated) { |
2235 FakeConstraints constraints; | 2189 FakeConstraints constraints; |
2236 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2190 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2237 true); | 2191 true); |
2238 CreatePeerConnection(&constraints); | 2192 CreatePeerConnection(&constraints); |
2239 CreateAndSetRemoteOffer(kSdpStringWithoutStreamsAudioOnly); | 2193 CreateAndSetRemoteOffer(kSdpStringWithoutStreamsAudioOnly); |
2240 | 2194 |
2241 ASSERT_EQ(1u, observer_.remote_streams()->count()); | 2195 ASSERT_EQ(1u, observer_.remote_streams()->count()); |
2242 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); | 2196 MediaStreamInterface* remote_stream = observer_.remote_streams()->at(0); |
2243 ASSERT_EQ(1u, remote_stream->GetAudioTracks().size()); | 2197 ASSERT_EQ(1u, remote_stream->GetAudioTracks().size()); |
2244 | 2198 |
(...skipping 14 matching lines...) Expand all Loading... |
2259 CreatePeerConnection(&constraints); | 2213 CreatePeerConnection(&constraints); |
2260 CreateAndSetRemoteOffer(kSdpStringWithStream1); | 2214 CreateAndSetRemoteOffer(kSdpStringWithStream1); |
2261 rtc::scoped_refptr<StreamCollection> reference(CreateStreamCollection(1)); | 2215 rtc::scoped_refptr<StreamCollection> reference(CreateStreamCollection(1)); |
2262 EXPECT_TRUE( | 2216 EXPECT_TRUE( |
2263 CompareStreamCollections(observer_.remote_streams(), reference.get())); | 2217 CompareStreamCollections(observer_.remote_streams(), reference.get())); |
2264 | 2218 |
2265 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); | 2219 CreateAndSetRemoteOffer(kSdpStringWithoutStreams); |
2266 EXPECT_EQ(0u, observer_.remote_streams()->count()); | 2220 EXPECT_EQ(0u, observer_.remote_streams()->count()); |
2267 } | 2221 } |
2268 | 2222 |
2269 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2270 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2271 #define MAYBE_LocalDescriptionChanged DISABLED_LocalDescriptionChanged | |
2272 #else | |
2273 #define MAYBE_LocalDescriptionChanged LocalDescriptionChanged | |
2274 #endif | |
2275 // This tests that an RtpSender is created when the local description is set | 2223 // This tests that an RtpSender is created when the local description is set |
2276 // after adding a local stream. | 2224 // after adding a local stream. |
2277 // TODO(deadbeef): This test and the one below it need to be updated when | 2225 // TODO(deadbeef): This test and the one below it need to be updated when |
2278 // an RtpSender's lifetime isn't determined by when a local description is set. | 2226 // an RtpSender's lifetime isn't determined by when a local description is set. |
2279 TEST_F(PeerConnectionInterfaceTest, MAYBE_LocalDescriptionChanged) { | 2227 TEST_F(PeerConnectionInterfaceTest, LocalDescriptionChanged) { |
2280 FakeConstraints constraints; | 2228 FakeConstraints constraints; |
2281 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2229 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2282 true); | 2230 true); |
2283 CreatePeerConnection(&constraints); | 2231 CreatePeerConnection(&constraints); |
2284 // Create an offer just to ensure we have an identity before we manually | 2232 // Create an offer just to ensure we have an identity before we manually |
2285 // call SetLocalDescription. | 2233 // call SetLocalDescription. |
2286 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; | 2234 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; |
2287 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); | 2235 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); |
2288 | 2236 |
2289 rtc::scoped_ptr<SessionDescriptionInterface> desc_1 = | 2237 rtc::scoped_ptr<SessionDescriptionInterface> desc_1 = |
(...skipping 15 matching lines...) Expand all Loading... |
2305 pc_->AddStream(reference_collection_->at(0)); | 2253 pc_->AddStream(reference_collection_->at(0)); |
2306 EXPECT_TRUE(DoSetLocalDescription(desc_2.release())); | 2254 EXPECT_TRUE(DoSetLocalDescription(desc_2.release())); |
2307 senders = pc_->GetSenders(); | 2255 senders = pc_->GetSenders(); |
2308 EXPECT_EQ(2u, senders.size()); | 2256 EXPECT_EQ(2u, senders.size()); |
2309 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); | 2257 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); |
2310 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); | 2258 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); |
2311 EXPECT_FALSE(ContainsSender(senders, kAudioTracks[1])); | 2259 EXPECT_FALSE(ContainsSender(senders, kAudioTracks[1])); |
2312 EXPECT_FALSE(ContainsSender(senders, kVideoTracks[1])); | 2260 EXPECT_FALSE(ContainsSender(senders, kVideoTracks[1])); |
2313 } | 2261 } |
2314 | 2262 |
2315 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2316 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2317 #define MAYBE_AddLocalStreamAfterLocalDescriptionChanged \ | |
2318 DISABLED_AddLocalStreamAfterLocalDescriptionChanged | |
2319 #else | |
2320 #define MAYBE_AddLocalStreamAfterLocalDescriptionChanged \ | |
2321 AddLocalStreamAfterLocalDescriptionChanged | |
2322 #endif | |
2323 // This tests that an RtpSender is created when the local description is set | 2263 // This tests that an RtpSender is created when the local description is set |
2324 // before adding a local stream. | 2264 // before adding a local stream. |
2325 TEST_F(PeerConnectionInterfaceTest, | 2265 TEST_F(PeerConnectionInterfaceTest, |
2326 MAYBE_AddLocalStreamAfterLocalDescriptionChanged) { | 2266 AddLocalStreamAfterLocalDescriptionChanged) { |
2327 FakeConstraints constraints; | 2267 FakeConstraints constraints; |
2328 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2268 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2329 true); | 2269 true); |
2330 CreatePeerConnection(&constraints); | 2270 CreatePeerConnection(&constraints); |
2331 // Create an offer just to ensure we have an identity before we manually | 2271 // Create an offer just to ensure we have an identity before we manually |
2332 // call SetLocalDescription. | 2272 // call SetLocalDescription. |
2333 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; | 2273 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; |
2334 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); | 2274 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); |
2335 | 2275 |
2336 rtc::scoped_ptr<SessionDescriptionInterface> desc_1 = | 2276 rtc::scoped_ptr<SessionDescriptionInterface> desc_1 = |
2337 CreateSessionDescriptionAndReference(2, 2); | 2277 CreateSessionDescriptionAndReference(2, 2); |
2338 | 2278 |
2339 EXPECT_TRUE(DoSetLocalDescription(desc_1.release())); | 2279 EXPECT_TRUE(DoSetLocalDescription(desc_1.release())); |
2340 auto senders = pc_->GetSenders(); | 2280 auto senders = pc_->GetSenders(); |
2341 EXPECT_EQ(0u, senders.size()); | 2281 EXPECT_EQ(0u, senders.size()); |
2342 | 2282 |
2343 pc_->AddStream(reference_collection_->at(0)); | 2283 pc_->AddStream(reference_collection_->at(0)); |
2344 senders = pc_->GetSenders(); | 2284 senders = pc_->GetSenders(); |
2345 EXPECT_EQ(4u, senders.size()); | 2285 EXPECT_EQ(4u, senders.size()); |
2346 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); | 2286 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); |
2347 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); | 2287 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); |
2348 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[1])); | 2288 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[1])); |
2349 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[1])); | 2289 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[1])); |
2350 } | 2290 } |
2351 | 2291 |
2352 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2353 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2354 #define MAYBE_ChangeSsrcOnTrackInLocalSessionDescription \ | |
2355 DISABLED_ChangeSsrcOnTrackInLocalSessionDescription | |
2356 #else | |
2357 #define MAYBE_ChangeSsrcOnTrackInLocalSessionDescription \ | |
2358 ChangeSsrcOnTrackInLocalSessionDescription | |
2359 #endif | |
2360 // This tests that the expected behavior occurs if the SSRC on a local track is | 2292 // This tests that the expected behavior occurs if the SSRC on a local track is |
2361 // changed when SetLocalDescription is called. | 2293 // changed when SetLocalDescription is called. |
2362 TEST_F(PeerConnectionInterfaceTest, | 2294 TEST_F(PeerConnectionInterfaceTest, |
2363 MAYBE_ChangeSsrcOnTrackInLocalSessionDescription) { | 2295 ChangeSsrcOnTrackInLocalSessionDescription) { |
2364 FakeConstraints constraints; | 2296 FakeConstraints constraints; |
2365 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2297 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2366 true); | 2298 true); |
2367 CreatePeerConnection(&constraints); | 2299 CreatePeerConnection(&constraints); |
2368 // Create an offer just to ensure we have an identity before we manually | 2300 // Create an offer just to ensure we have an identity before we manually |
2369 // call SetLocalDescription. | 2301 // call SetLocalDescription. |
2370 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; | 2302 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; |
2371 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); | 2303 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); |
2372 | 2304 |
2373 rtc::scoped_ptr<SessionDescriptionInterface> desc = | 2305 rtc::scoped_ptr<SessionDescriptionInterface> desc = |
(...skipping 23 matching lines...) Expand all Loading... |
2397 | 2329 |
2398 EXPECT_TRUE(DoSetLocalDescription(updated_desc.release())); | 2330 EXPECT_TRUE(DoSetLocalDescription(updated_desc.release())); |
2399 senders = pc_->GetSenders(); | 2331 senders = pc_->GetSenders(); |
2400 EXPECT_EQ(2u, senders.size()); | 2332 EXPECT_EQ(2u, senders.size()); |
2401 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); | 2333 EXPECT_TRUE(ContainsSender(senders, kAudioTracks[0])); |
2402 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); | 2334 EXPECT_TRUE(ContainsSender(senders, kVideoTracks[0])); |
2403 // TODO(deadbeef): Once RtpSenders expose parameters, check that the SSRC | 2335 // TODO(deadbeef): Once RtpSenders expose parameters, check that the SSRC |
2404 // changed. | 2336 // changed. |
2405 } | 2337 } |
2406 | 2338 |
2407 // Disabled on Win dbg: https://bugs.chromium.org/p/webrtc/issues/detail?id=5659 | |
2408 #if defined(WEBRTC_WIN) && defined(_DEBUG) | |
2409 #define MAYBE_SignalSameTracksInSeparateMediaStream \ | |
2410 DISABLED_SignalSameTracksInSeparateMediaStream | |
2411 #else | |
2412 #define MAYBE_SignalSameTracksInSeparateMediaStream \ | |
2413 SignalSameTracksInSeparateMediaStream | |
2414 #endif | |
2415 // This tests that the expected behavior occurs if a new session description is | 2339 // This tests that the expected behavior occurs if a new session description is |
2416 // set with the same tracks, but on a different MediaStream. | 2340 // set with the same tracks, but on a different MediaStream. |
2417 TEST_F(PeerConnectionInterfaceTest, | 2341 TEST_F(PeerConnectionInterfaceTest, |
2418 MAYBE_SignalSameTracksInSeparateMediaStream) { | 2342 SignalSameTracksInSeparateMediaStream) { |
2419 FakeConstraints constraints; | 2343 FakeConstraints constraints; |
2420 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, | 2344 constraints.AddMandatory(webrtc::MediaConstraintsInterface::kEnableDtlsSrtp, |
2421 true); | 2345 true); |
2422 CreatePeerConnection(&constraints); | 2346 CreatePeerConnection(&constraints); |
2423 // Create an offer just to ensure we have an identity before we manually | 2347 // Create an offer just to ensure we have an identity before we manually |
2424 // call SetLocalDescription. | 2348 // call SetLocalDescription. |
2425 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; | 2349 rtc::scoped_ptr<SessionDescriptionInterface> throwaway; |
2426 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); | 2350 ASSERT_TRUE(DoCreateOffer(&throwaway, nullptr)); |
2427 | 2351 |
2428 rtc::scoped_ptr<SessionDescriptionInterface> desc = | 2352 rtc::scoped_ptr<SessionDescriptionInterface> desc = |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2738 FakeConstraints updated_answer_c; | 2662 FakeConstraints updated_answer_c; |
2739 answer_c.SetMandatoryReceiveAudio(false); | 2663 answer_c.SetMandatoryReceiveAudio(false); |
2740 answer_c.SetMandatoryReceiveVideo(false); | 2664 answer_c.SetMandatoryReceiveVideo(false); |
2741 | 2665 |
2742 cricket::MediaSessionOptions updated_answer_options; | 2666 cricket::MediaSessionOptions updated_answer_options; |
2743 EXPECT_TRUE( | 2667 EXPECT_TRUE( |
2744 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); | 2668 ParseConstraintsForAnswer(&updated_answer_c, &updated_answer_options)); |
2745 EXPECT_TRUE(updated_answer_options.has_audio()); | 2669 EXPECT_TRUE(updated_answer_options.has_audio()); |
2746 EXPECT_TRUE(updated_answer_options.has_video()); | 2670 EXPECT_TRUE(updated_answer_options.has_video()); |
2747 } | 2671 } |
OLD | NEW |