Provide the default implementation of QuicheTestLoopback

This is just the implementation from Chromium.

PiperOrigin-RevId: 441203828
diff --git a/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.cc b/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.cc
new file mode 100644
index 0000000..661952e
--- /dev/null
+++ b/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.cc
@@ -0,0 +1,32 @@
+// 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 "quiche_platform_impl/quiche_test_loopback_impl.h"
+
+namespace quiche {
+
+quic::IpAddressFamily AddressFamilyUnderTestImpl() {
+  return quic::IpAddressFamily::IP_V4;
+}
+
+quic::QuicIpAddress TestLoopback4Impl() {
+  return quic::QuicIpAddress::Loopback4();
+}
+
+quic::QuicIpAddress TestLoopback6Impl() {
+  return quic::QuicIpAddress::Loopback6();
+}
+
+quic::QuicIpAddress TestLoopbackImpl() {
+  return quic::QuicIpAddress::Loopback4();
+}
+
+quic::QuicIpAddress TestLoopbackImpl(int index) {
+  const char kLocalhostIPv4[] = {127, 0, 0, static_cast<char>(index)};
+  quic::QuicIpAddress address;
+  address.FromPackedString(kLocalhostIPv4, 4);
+  return address;
+}
+
+}  // namespace quiche
diff --git a/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.h b/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.h
new file mode 100644
index 0000000..228bbb8
--- /dev/null
+++ b/quiche/common/platform/default/quiche_platform_impl/quiche_test_loopback_impl.h
@@ -0,0 +1,29 @@
+// 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.
+
+#ifndef QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_
+#define QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_
+
+#include "quiche/quic/platform/api/quic_ip_address.h"
+
+namespace quiche {
+
+// Returns the address family IPv4 used to run test under.
+quic::IpAddressFamily AddressFamilyUnderTestImpl();
+
+// Returns an IPv4 loopback address.
+quic::QuicIpAddress TestLoopback4Impl();
+
+// Returns the only IPv6 loopback address.
+quic::QuicIpAddress TestLoopback6Impl();
+
+// Returns an IPv4 loopback address.
+quic::QuicIpAddress TestLoopbackImpl();
+
+// Returns an indexed IPv4 loopback address.
+quic::QuicIpAddress TestLoopbackImpl(int index);
+
+}  // namespace quiche
+
+#endif  // QUICHE_COMMON_PLATFORM_DEFAULT_QUICHE_PLATFORM_IMPL_QUICHE_TEST_LOOPBACK_IMPL_H_