OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |