Pretty print AlternativeService in test macros.
Pretty print AlternativeService in test macros.

Implement PrintTo(const AlternativeService&, std::ostream*) so that when
EXPECT_EQ or ASSERT_EQ fails between two AlternativeService structs, the test
output contains protocol names and hostnames pretty printed, instead of a binary
blob including useless things like the memory address of where std::string
stores the hostname.  See src/testing/gtest/include/gtest/gtest-printers.h for
more information.

Currently used in AlternateProtocolServerPropertiesTest.BrokenShadowsCanonical
only, but more tests involving EXPECT_EQ between AlternativeService structs are
coming.

An earlier version of this CL landed at https://crrev.com/1212813006 and got
reverted because on iOS, the helper function required registering an ataxit
handler.  This version does things differently by
 * using PrintTo instead of operator<<, just because this is listed first in the
   comments in gtest-printers.h;
 * defining the function in http_server_properties_impl_unittests.cc instead of
   declaring it in http_server_properties.h with NET_EXPORT, this will make sure
   that no static initializers will be introduced.

Note, however, that this helper function cannot be defined in anonymous
namespace, gtest would not find it there.

BUG=392575

Review URL: https://codereview.chromium.org/1213133003

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#336763}

Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,Just-D/chromium-1,Just-D/chromium-1,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,chuan9/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,Chilledheart/chromium,TheTypoMaster/chromium-crosswalk,chuan9/chromium-crosswalk,axinging/chromium-crosswalk,Just-D/chromium-1,axinging/chromium-crosswalk,axinging/chromium-crosswalk,axinging/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Just-D/chromium-1,chuan9/chromium-crosswalk,hgl888/chromium-crosswalk,hgl888/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Pluto-tv/chromium-crosswalk,Chilledheart/chromium,axinging/chromium-crosswalk,Chilledheart/chromium,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,hgl888/chromium-crosswalk,chuan9/chromium-crosswalk,Just-D/chromium-1,Chilledheart/chromium,Pluto-tv/chromium-crosswalk