Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: webrtc/pc/peerconnection_integrationtest.cc

Issue 2815513012: Negotiate the same SRTP crypto suites for every DTLS association formed. (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2318 matching lines...) Expand 10 before | Expand all | Expand 10 after
2329 // Ensure data can be sent in both directions. 2329 // Ensure data can be sent in both directions.
2330 std::string data = "hello world"; 2330 std::string data = "hello world";
2331 caller()->data_channel()->Send(DataBuffer(data)); 2331 caller()->data_channel()->Send(DataBuffer(data));
2332 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(), 2332 EXPECT_EQ_WAIT(data, callee()->data_observer()->last_message(),
2333 kDefaultTimeout); 2333 kDefaultTimeout);
2334 callee()->data_channel()->Send(DataBuffer(data)); 2334 callee()->data_channel()->Send(DataBuffer(data));
2335 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(), 2335 EXPECT_EQ_WAIT(data, caller()->data_observer()->last_message(),
2336 kDefaultTimeout); 2336 kDefaultTimeout);
2337 } 2337 }
2338 2338
2339 // Set up a connection initially just using SCTP data channels, later upgrading
2340 // to audio/video, ensuring frames are received end-to-end. Effectively the
2341 // inverse of the test above.
2342 // This was broken in M57; see https://crbug.com/711243
2343 TEST_F(PeerConnectionIntegrationTest, SctpDataChannelToAudioVideoUpgrade) {
2344 ASSERT_TRUE(CreatePeerConnectionWrappers());
2345 ConnectFakeSignaling();
2346 // Do initial offer/answer with just data channel.
2347 caller()->CreateDataChannel();
2348 caller()->CreateAndSetAndSignalOffer();
2349 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
2350 // Wait until data can be sent over the data channel.
2351 ASSERT_TRUE_WAIT(callee()->data_channel() != nullptr, kDefaultTimeout);
2352 ASSERT_TRUE_WAIT(caller()->data_observer()->IsOpen(), kDefaultTimeout);
2353 ASSERT_TRUE_WAIT(callee()->data_observer()->IsOpen(), kDefaultTimeout);
2354
2355 // Do subsequent offer/answer with two-way audio and video. Audio and video
2356 // should end up bundled on the DTLS/ICE transport already used for data.
2357 caller()->AddAudioVideoMediaStream();
2358 callee()->AddAudioVideoMediaStream();
2359 caller()->CreateAndSetAndSignalOffer();
2360 ASSERT_TRUE_WAIT(SignalingStateStable(), kDefaultTimeout);
2361 ExpectNewFramesReceivedWithWait(
2362 kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
2363 kDefaultExpectedAudioFrameCount, kDefaultExpectedVideoFrameCount,
2364 kMaxWaitForFramesMs);
2365 }
2366
2339 #endif // HAVE_SCTP 2367 #endif // HAVE_SCTP
2340 2368
2341 // Test that the ICE connection and gathering states eventually reach 2369 // Test that the ICE connection and gathering states eventually reach
2342 // "complete". 2370 // "complete".
2343 TEST_F(PeerConnectionIntegrationTest, IceStatesReachCompletion) { 2371 TEST_F(PeerConnectionIntegrationTest, IceStatesReachCompletion) {
2344 ASSERT_TRUE(CreatePeerConnectionWrappers()); 2372 ASSERT_TRUE(CreatePeerConnectionWrappers());
2345 ConnectFakeSignaling(); 2373 ConnectFakeSignaling();
2346 // Do normal offer/answer. 2374 // Do normal offer/answer.
2347 caller()->AddAudioVideoMediaStream(); 2375 caller()->AddAudioVideoMediaStream();
2348 callee()->AddAudioVideoMediaStream(); 2376 callee()->AddAudioVideoMediaStream();
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 2797
2770 auto contributing_sources = receiver->GetSources(); 2798 auto contributing_sources = receiver->GetSources();
2771 ASSERT_GT(receiver->GetParameters().encodings.size(), 0u); 2799 ASSERT_GT(receiver->GetParameters().encodings.size(), 0u);
2772 EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc, 2800 EXPECT_EQ(receiver->GetParameters().encodings[0].ssrc,
2773 contributing_sources[0].source_id()); 2801 contributing_sources[0].source_id());
2774 } 2802 }
2775 2803
2776 } // namespace 2804 } // namespace
2777 2805
2778 #endif // if !defined(THREAD_SANITIZER) 2806 #endif // if !defined(THREAD_SANITIZER)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698