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

Side by Side Diff: net/quic/test_tools/quic_test_utils.cc

Issue 1809863002: Update some callers to use more direct ways of constructing IPAddress from well known literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rch feedbak Created 4 years, 9 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 | « net/quic/quic_connection_test.cc ('k') | net/tools/quic/end_to_end_test.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 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/test_tools/quic_test_utils.h" 5 #include "net/quic/test_tools/quic_test_utils.h"
6 6
7 #include "base/sha1.h" 7 #include "base/sha1.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "net/quic/crypto/crypto_framer.h" 10 #include "net/quic/crypto/crypto_framer.h"
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 449
450 QuicVersion QuicVersionMax() { 450 QuicVersion QuicVersionMax() {
451 return QuicSupportedVersions().front(); 451 return QuicSupportedVersions().front();
452 } 452 }
453 453
454 QuicVersion QuicVersionMin() { 454 QuicVersion QuicVersionMin() {
455 return QuicSupportedVersions().back(); 455 return QuicSupportedVersions().back();
456 } 456 }
457 457
458 IPAddress Loopback4() { 458 IPAddress Loopback4() {
459 return IPAddress(127, 0, 0, 1); 459 return IPAddress::IPv4Localhost();
460 } 460 }
461 461
462 IPAddress Loopback6() { 462 IPAddress Loopback6() {
463 IPAddress addr; 463 return IPAddress::IPv6Localhost();
464 CHECK(addr.AssignFromIPLiteral("::1"));
465 return addr;
466 } 464 }
467 465
468 IPAddress Any4() { 466 IPAddress Any4() {
469 return IPAddress(0, 0, 0, 0); 467 return IPAddress::IPv4AllZeros();
470 } 468 }
471 469
472 void GenerateBody(string* body, int length) { 470 void GenerateBody(string* body, int length) {
473 body->clear(); 471 body->clear();
474 body->reserve(length); 472 body->reserve(length);
475 for (int i = 0; i < length; ++i) { 473 for (int i = 0; i < length; ++i) {
476 body->append(1, static_cast<char>(32 + i % (126 - 32))); 474 body->append(1, static_cast<char>(32 + i % (126 - 32)));
477 } 475 }
478 } 476 }
479 477
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 // strike register worries that we've just overflowed a uint32_t time. 795 // strike register worries that we've just overflowed a uint32_t time.
798 (*server_connection)->AdvanceTime(connection_start_time); 796 (*server_connection)->AdvanceTime(connection_start_time);
799 } 797 }
800 798
801 QuicStreamId QuicClientDataStreamId(int i) { 799 QuicStreamId QuicClientDataStreamId(int i) {
802 return kClientDataStreamId1 + 2 * i; 800 return kClientDataStreamId1 + 2 * i;
803 } 801 }
804 802
805 } // namespace test 803 } // namespace test
806 } // namespace net 804 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698