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

Unified Diff: net/quic/platform/impl/quic_test_loopback_impl.cc

Issue 2933613002: Add quic_test_loopback used for tests only. (Closed)
Patch Set: Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/platform/impl/quic_test_loopback_impl.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/platform/impl/quic_test_loopback_impl.cc
diff --git a/net/quic/platform/impl/quic_test_loopback_impl.cc b/net/quic/platform/impl/quic_test_loopback_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b836eb5592fb6544ecce69ccf8ffe0bdfc89829e
--- /dev/null
+++ b/net/quic/platform/impl/quic_test_loopback_impl.cc
@@ -0,0 +1,30 @@
+// Copyright (c) 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "net/quic/platform/impl/quic_test_loopback_impl.h"
+
+namespace net {
+
+IpAddressFamily AddressFamilyUnderTestImpl() {
+ return IpAddressFamily::IP_V4;
+}
+
+QuicIpAddress TestLoopback4Impl() {
+ return QuicIpAddress(QuicIpAddressImpl(IPAddress::IPv4Localhost()));
+}
+
+QuicIpAddress TestLoopback6Impl() {
+ return QuicIpAddress(QuicIpAddressImpl(IPAddress::IPv6Localhost()));
+}
+
+QuicIpAddress TestLoopbackImpl() {
+ return QuicIpAddress(QuicIpAddressImpl(IPAddress::IPv4Localhost()));
+}
+
+QuicIpAddress TestLoopbackImpl(int index) {
+ const uint8_t kLocalhostIPv4[] = {127, 0, 0, index};
+ return QuicIpAddress(QuicIpAddressImpl(IPAddress(kLocalhostIPv4)));
+}
+
+} // namespace net
« no previous file with comments | « net/quic/platform/impl/quic_test_loopback_impl.h ('k') | net/tools/quic/end_to_end_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698