| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "net/quic/quic_header_list.h" | |
| 6 | |
| 7 #include "net/test/gtest_util.h" | |
| 8 #include "testing/gmock/include/gmock/gmock.h" | |
| 9 | |
| 10 namespace net { | |
| 11 | |
| 12 // This test verifies that QuicHeaderList accumulates header pairs in order. | |
| 13 TEST(QuicHeaderListTest, OnHeader) { | |
| 14 QuicHeaderList headers; | |
| 15 headers.OnHeader("foo", "bar"); | |
| 16 headers.OnHeader("april", "fools"); | |
| 17 headers.OnHeader("beep", ""); | |
| 18 | |
| 19 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers.DebugString()); | |
| 20 } | |
| 21 | |
| 22 // This test verifies that QuicHeaderList is copyable and assignable. | |
| 23 TEST(QuicHeaderListTest, IsCopyableAndAssignable) { | |
| 24 QuicHeaderList headers; | |
| 25 headers.OnHeader("foo", "bar"); | |
| 26 headers.OnHeader("april", "fools"); | |
| 27 headers.OnHeader("beep", ""); | |
| 28 | |
| 29 QuicHeaderList headers2(headers); | |
| 30 QuicHeaderList headers3 = headers; | |
| 31 | |
| 32 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers2.DebugString()); | |
| 33 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers3.DebugString()); | |
| 34 } | |
| 35 | |
| 36 } // namespace net | |
| OLD | NEW |