src/net/dns/esni_content_unittest.cc
// Test that merging multiple keys corresponding to a single address works.
Test that merging multiple keys corresponding to a single address works.
Test that merging multiple keys corresponding to a single address works .
TEST(EsniContentTest, MergeKeysForSingleHost) {
  EsniContent c1, c2;
  IPAddress address = MakeIPAddress();
  c1.AddKeyForAddress(address, "a");
  c1.AddKeyForAddress(address, "b");
  c2.AddKeyForAddress(address, "b");
  c2.AddKeyForAddress(address, "c");
  c1.MergeFrom(c2);
  EXPECT_THAT(c1.keys(), ::testing::UnorderedElementsAre("a", "b", "c"));
  EXPECT_THAT(c1.keys_for_addresses(),
              ::testing::UnorderedElementsAre(::testing::Pair(
                  address, ::testing::UnorderedElementsAre("a", "b", "c"))));
}
TEST ( EsniContentTest , MergeKeysForSingleHost ) { EsniContent c1 , c2 ; IPAddress address = MakeIPAddress ( ) ; c1 . AddKeyForAddress ( address , " " ) ; c1 . AddKeyForAddress ( address , " " ) ; c2 . AddKeyForAddress ( address , " " ) ; c2 . AddKeyForAddress ( address , " " ) ; c1 . MergeFrom ( c2 ) ; EXPECT_THAT ( c1 . keys ( ) , :: testing :: UnorderedElementsAre ( " " , " " , " " ) ) ; EXPECT_THAT ( c1 . keys_for_addresses ( ) , :: testing :: UnorderedElementsAre ( :: testing :: Pair ( address , :: testing :: UnorderedElementsAre ( " " , " " , " " ) ) ) ) ; }
Test that merging multiple keys corresponding to a single address works.
Test that merging multiple keys corresponding to a single address works .