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

Side by Side Diff: webrtc/base/sslstreamadapter_unittest.cc

Issue 2623473004: Replace all use of the VERIFY macro. (Closed)
Patch Set: Delete a DCHECK, instead log and return failure. And fix compile error in previous patch set. Created 3 years, 10 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 2011 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2011 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 void TestHandshake(bool expect_success = true) { 370 void TestHandshake(bool expect_success = true) {
371 server_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : 371 server_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS :
372 rtc::SSL_MODE_TLS); 372 rtc::SSL_MODE_TLS);
373 client_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : 373 client_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS :
374 rtc::SSL_MODE_TLS); 374 rtc::SSL_MODE_TLS);
375 375
376 if (!dtls_) { 376 if (!dtls_) {
377 // Make sure we simulate a reliable network for TLS. 377 // Make sure we simulate a reliable network for TLS.
378 // This is just a check to make sure that people don't write wrong 378 // This is just a check to make sure that people don't write wrong
379 // tests. 379 // tests.
380 RTC_CHECK((mtu_ == 1460) && (loss_ == 0) && (lose_first_packet_ == 0)); 380 RTC_CHECK_EQ(1460, mtu_);
381 RTC_CHECK(!loss_);
382 RTC_CHECK(!lose_first_packet_);
381 } 383 }
382 384
383 if (!identities_set_) 385 if (!identities_set_)
384 SetPeerIdentitiesByDigest(true, true); 386 SetPeerIdentitiesByDigest(true, true);
385 387
386 // Start the handshake 388 // Start the handshake
387 int rv; 389 int rv;
388 390
389 server_ssl_->SetServerRole(); 391 server_ssl_->SetServerRole();
390 rv = server_ssl_->StartSSL(); 392 rv = server_ssl_->StartSSL();
(...skipping 16 matching lines...) Expand all
407 // This tests that the handshake can complete before the identity is 409 // This tests that the handshake can complete before the identity is
408 // verified, and the identity will be verified after the fact. 410 // verified, and the identity will be verified after the fact.
409 void TestHandshakeWithDelayedIdentity(bool valid_identity) { 411 void TestHandshakeWithDelayedIdentity(bool valid_identity) {
410 server_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : rtc::SSL_MODE_TLS); 412 server_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : rtc::SSL_MODE_TLS);
411 client_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : rtc::SSL_MODE_TLS); 413 client_ssl_->SetMode(dtls_ ? rtc::SSL_MODE_DTLS : rtc::SSL_MODE_TLS);
412 414
413 if (!dtls_) { 415 if (!dtls_) {
414 // Make sure we simulate a reliable network for TLS. 416 // Make sure we simulate a reliable network for TLS.
415 // This is just a check to make sure that people don't write wrong 417 // This is just a check to make sure that people don't write wrong
416 // tests. 418 // tests.
417 RTC_CHECK((mtu_ == 1460) && (loss_ == 0) && (lose_first_packet_ == 0)); 419 RTC_CHECK_EQ(1460, mtu_);
420 RTC_CHECK(!loss_);
421 RTC_CHECK(!lose_first_packet_);
418 } 422 }
419 423
420 // Start the handshake 424 // Start the handshake
421 int rv; 425 int rv;
422 426
423 server_ssl_->SetServerRole(); 427 server_ssl_->SetServerRole();
424 rv = server_ssl_->StartSSL(); 428 rv = server_ssl_->StartSSL();
425 ASSERT_EQ(0, rv); 429 ASSERT_EQ(0, rv);
426 430
427 rv = client_ssl_->StartSSL(); 431 rv = client_ssl_->StartSSL();
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); 1343 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256))));
1340 INSTANTIATE_TEST_CASE_P( 1344 INSTANTIATE_TEST_CASE_P(
1341 SSLStreamAdapterTestsDTLS, 1345 SSLStreamAdapterTestsDTLS,
1342 SSLStreamAdapterTestDTLS, 1346 SSLStreamAdapterTestDTLS,
1343 Combine(Values(rtc::KeyParams::RSA(1024, 65537), 1347 Combine(Values(rtc::KeyParams::RSA(1024, 65537),
1344 rtc::KeyParams::RSA(1152, 65537), 1348 rtc::KeyParams::RSA(1152, 65537),
1345 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)), 1349 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)),
1346 Values(rtc::KeyParams::RSA(1024, 65537), 1350 Values(rtc::KeyParams::RSA(1024, 65537),
1347 rtc::KeyParams::RSA(1152, 65537), 1351 rtc::KeyParams::RSA(1152, 65537),
1348 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256)))); 1352 rtc::KeyParams::ECDSA(rtc::EC_NIST_P256))));
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698