1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef NET_DNS_HOST_RESOLVER_RESULTS_TEST_UTIL_H_ 6 #define NET_DNS_HOST_RESOLVER_RESULTS_TEST_UTIL_H_ 7 8 #include <ostream> 9 #include <vector> 10 11 #include "net/base/connection_endpoint_metadata_test_util.h" 12 #include "net/base/ip_endpoint.h" 13 #include "testing/gmock/include/gmock/gmock.h" 14 #include "testing/gtest/include/gtest/gtest.h" 15 16 namespace net { 17 18 struct ConnectionEndpointMetadata; 19 struct HostResolverEndpointResult; 20 struct ServiceEndpoint; 21 22 testing::Matcher<const HostResolverEndpointResult&> ExpectEndpointResult( 23 testing::Matcher<std::vector<IPEndPoint>> ip_endpoints_matcher = 24 testing::IsEmpty(), 25 testing::Matcher<const ConnectionEndpointMetadata&> metadata_matcher = 26 ExpectConnectionEndpointMetadata()); 27 28 testing::Matcher<const ServiceEndpoint&> ExpectServiceEndpoint( 29 testing::Matcher<std::vector<IPEndPoint>> ipv4_endpoints_matcher = 30 testing::IsEmpty(), 31 testing::Matcher<std::vector<IPEndPoint>> ipv6_endpoints_matcher = 32 testing::IsEmpty(), 33 testing::Matcher<const ConnectionEndpointMetadata&> metadata_matcher = 34 ExpectConnectionEndpointMetadata()); 35 36 std::ostream& operator<<(std::ostream& os, 37 const HostResolverEndpointResult& endpoint_result); 38 39 std::ostream& operator<<(std::ostream& os, const ServiceEndpoint& endpoint); 40 41 } // namespace net 42 43 #endif // NET_DNS_HOST_RESOLVER_RESULTS_TEST_UTIL_H_ 44