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

Side by Side Diff: webrtc/api/webrtcsession_unittest.cc

Issue 2622413005: Replace use of ASSERT in test code. (Closed)
Patch Set: Fixed another signed/unsigned comparison. Created 3 years, 11 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
« no previous file with comments | « webrtc/api/test/mockpeerconnectionobservers.h ('k') | webrtc/base/network_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1432 matching lines...) Expand 10 before | Expand all | Expand 10 after
1443 std::vector<cricket::AudioCodec> codecs = 1443 std::vector<cricket::AudioCodec> codecs =
1444 media_engine_->audio_send_codecs(); 1444 media_engine_->audio_send_codecs();
1445 codecs.push_back(kCNCodec1); 1445 codecs.push_back(kCNCodec1);
1446 codecs.push_back(kCNCodec2); 1446 codecs.push_back(kCNCodec2);
1447 media_engine_->SetAudioCodecs(codecs); 1447 media_engine_->SetAudioCodecs(codecs);
1448 desc_factory_->set_audio_codecs(codecs, codecs); 1448 desc_factory_->set_audio_codecs(codecs, codecs);
1449 } 1449 }
1450 1450
1451 bool VerifyNoCNCodecs(const cricket::ContentInfo* content) { 1451 bool VerifyNoCNCodecs(const cricket::ContentInfo* content) {
1452 const cricket::ContentDescription* description = content->description; 1452 const cricket::ContentDescription* description = content->description;
1453 ASSERT(description != NULL); 1453 RTC_CHECK(description != NULL);
1454 const cricket::AudioContentDescription* audio_content_desc = 1454 const cricket::AudioContentDescription* audio_content_desc =
1455 static_cast<const cricket::AudioContentDescription*>(description); 1455 static_cast<const cricket::AudioContentDescription*>(description);
1456 ASSERT(audio_content_desc != NULL); 1456 RTC_CHECK(audio_content_desc != NULL);
1457 for (size_t i = 0; i < audio_content_desc->codecs().size(); ++i) { 1457 for (size_t i = 0; i < audio_content_desc->codecs().size(); ++i) {
1458 if (audio_content_desc->codecs()[i].name == "CN") 1458 if (audio_content_desc->codecs()[i].name == "CN")
1459 return false; 1459 return false;
1460 } 1460 }
1461 return true; 1461 return true;
1462 } 1462 }
1463 1463
1464 void CreateDataChannel() { 1464 void CreateDataChannel() {
1465 webrtc::InternalDataChannelInit dci; 1465 webrtc::InternalDataChannelInit dci;
1466 ASSERT(session_.get()); 1466 RTC_CHECK(session_.get());
1467 dci.reliable = session_->data_channel_type() == cricket::DCT_SCTP; 1467 dci.reliable = session_->data_channel_type() == cricket::DCT_SCTP;
1468 data_channel_ = DataChannel::Create( 1468 data_channel_ = DataChannel::Create(
1469 session_.get(), session_->data_channel_type(), "datachannel", dci); 1469 session_.get(), session_->data_channel_type(), "datachannel", dci);
1470 } 1470 }
1471 1471
1472 void SetLocalDescriptionWithDataChannel() { 1472 void SetLocalDescriptionWithDataChannel() {
1473 CreateDataChannel(); 1473 CreateDataChannel();
1474 SessionDescriptionInterface* offer = CreateOffer(); 1474 SessionDescriptionInterface* offer = CreateOffer();
1475 SetLocalDescriptionWithoutError(offer); 1475 SetLocalDescriptionWithoutError(offer);
1476 } 1476 }
(...skipping 1598 matching lines...) Expand 10 before | Expand all | Expand 10 after
3075 SessionDescriptionInterface* offer = CreateRemoteOffer(); 3075 SessionDescriptionInterface* offer = CreateRemoteOffer();
3076 SetRemoteDescriptionWithoutError(offer); 3076 SetRemoteDescriptionWithoutError(offer);
3077 3077
3078 SessionDescriptionInterface* answer = CreateAnswer(); 3078 SessionDescriptionInterface* answer = CreateAnswer();
3079 SetLocalDescriptionWithoutError(answer); 3079 SetLocalDescriptionWithoutError(answer);
3080 3080
3081 EXPECT_EQ(session_->voice_rtp_transport_channel(), 3081 EXPECT_EQ(session_->voice_rtp_transport_channel(),
3082 session_->video_rtp_transport_channel()); 3082 session_->video_rtp_transport_channel());
3083 3083
3084 cricket::BaseChannel* voice_channel = session_->voice_channel(); 3084 cricket::BaseChannel* voice_channel = session_->voice_channel();
3085 ASSERT(voice_channel != NULL); 3085 ASSERT_TRUE(voice_channel != NULL);
3086 3086
3087 // Checks if one of the transport channels contains a connection using a given 3087 // Checks if one of the transport channels contains a connection using a given
3088 // port. 3088 // port.
3089 auto connection_with_remote_port = [this, voice_channel](int port) { 3089 auto connection_with_remote_port = [this, voice_channel](int port) {
3090 std::unique_ptr<webrtc::SessionStats> stats = session_->GetStats_s(); 3090 std::unique_ptr<webrtc::SessionStats> stats = session_->GetStats_s();
3091 for (auto& kv : stats->transport_stats) { 3091 for (auto& kv : stats->transport_stats) {
3092 for (auto& chan_stat : kv.second.channel_stats) { 3092 for (auto& chan_stat : kv.second.channel_stats) {
3093 for (auto& conn_info : chan_stat.connection_infos) { 3093 for (auto& conn_info : chan_stat.connection_infos) {
3094 if (conn_info.remote_candidate.address().port() == port) { 3094 if (conn_info.remote_candidate.address().port() == port) {
3095 return true; 3095 return true;
(...skipping 1347 matching lines...) Expand 10 before | Expand all | Expand 10 after
4443 } 4443 }
4444 4444
4445 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test 4445 // TODO(bemasc): Add a TestIceStatesBundle with BUNDLE enabled. That test
4446 // currently fails because upon disconnection and reconnection OnIceComplete is 4446 // currently fails because upon disconnection and reconnection OnIceComplete is
4447 // called more than once without returning to IceGatheringGathering. 4447 // called more than once without returning to IceGatheringGathering.
4448 4448
4449 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests, 4449 INSTANTIATE_TEST_CASE_P(WebRtcSessionTests,
4450 WebRtcSessionTest, 4450 WebRtcSessionTest,
4451 testing::Values(ALREADY_GENERATED, 4451 testing::Values(ALREADY_GENERATED,
4452 DTLS_IDENTITY_STORE)); 4452 DTLS_IDENTITY_STORE));
OLDNEW
« no previous file with comments | « webrtc/api/test/mockpeerconnectionobservers.h ('k') | webrtc/base/network_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698