Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(925)

Side by Side Diff: net/quic/core/quic_header_list_test.cc

Issue 2731223002: deprecate FLAGS_quic_reloadable_flag_quic_limit_uncompressed_headers (Closed)
Patch Set: Rebase Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/quic_header_list.cc ('k') | net/quic/core/quic_spdy_stream.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/core/quic_header_list.h" 5 #include "net/quic/core/quic_header_list.h"
6 6
7 #include "net/quic/core/quic_flags.h" 7 #include "net/quic/core/quic_flags.h"
8 #include "net/quic/test_tools/quic_test_utils.h" 8 #include "net/quic/test_tools/quic_test_utils.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 using std::string; 11 using std::string;
12 12
13 namespace net { 13 namespace net {
14 14
15 // This test verifies that QuicHeaderList accumulates header pairs in order. 15 // This test verifies that QuicHeaderList accumulates header pairs in order.
16 TEST(QuicHeaderListTest, OnHeader) { 16 TEST(QuicHeaderListTest, OnHeader) {
17 QuicHeaderList headers; 17 QuicHeaderList headers;
18 headers.OnHeader("foo", "bar"); 18 headers.OnHeader("foo", "bar");
19 headers.OnHeader("april", "fools"); 19 headers.OnHeader("april", "fools");
20 headers.OnHeader("beep", ""); 20 headers.OnHeader("beep", "");
21 21
22 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers.DebugString()); 22 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers.DebugString());
23 } 23 }
24 24
25 TEST(QuicHeaderListTest, TooLarge) { 25 TEST(QuicHeaderListTest, TooLarge) {
26 test::QuicFlagSaver flags;
27 FLAGS_quic_reloadable_flag_quic_limit_uncompressed_headers = true;
28 QuicHeaderList headers; 26 QuicHeaderList headers;
29 string key = "key"; 27 string key = "key";
30 string value(1 << 18, '1'); 28 string value(1 << 18, '1');
31 headers.OnHeader(key, value); 29 headers.OnHeader(key, value);
32 headers.OnHeaderBlockEnd(key.size() + value.size()); 30 headers.OnHeaderBlockEnd(key.size() + value.size());
33 EXPECT_TRUE(headers.empty()); 31 EXPECT_TRUE(headers.empty());
34 32
35 EXPECT_EQ("{ }", headers.DebugString()); 33 EXPECT_EQ("{ }", headers.DebugString());
36 } 34 }
37 35
(...skipping 15 matching lines...) Expand all
53 headers.OnHeader("beep", ""); 51 headers.OnHeader("beep", "");
54 52
55 QuicHeaderList headers2(headers); 53 QuicHeaderList headers2(headers);
56 QuicHeaderList headers3 = headers; 54 QuicHeaderList headers3 = headers;
57 55
58 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers2.DebugString()); 56 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers2.DebugString());
59 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers3.DebugString()); 57 EXPECT_EQ("{ foo=bar, april=fools, beep=, }", headers3.DebugString());
60 } 58 }
61 59
62 } // namespace net 60 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/core/quic_header_list.cc ('k') | net/quic/core/quic_spdy_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698