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

Side by Side Diff: net/spdy/chromium/header_coalescer_test.cc

Issue 2847133003: Add NetLog event for invalid Http/2 response header (Closed)
Patch Set: address comments Created 3 years, 7 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/spdy/chromium/header_coalescer.cc ('k') | net/spdy/chromium/spdy_session.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 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/spdy/chromium/header_coalescer.h" 5 #include "net/spdy/chromium/header_coalescer.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "net/log/net_log_with_source.h"
9 #include "net/spdy/platform/api/spdy_string.h" 10 #include "net/spdy/platform/api/spdy_string.h"
10 #include "net/spdy/platform/api/spdy_string_utils.h" 11 #include "net/spdy/platform/api/spdy_string_utils.h"
11 #include "testing/gmock/include/gmock/gmock.h" 12 #include "testing/gmock/include/gmock/gmock.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 using ::testing::ElementsAre; 15 using ::testing::ElementsAre;
15 using ::testing::Pair; 16 using ::testing::Pair;
16 17
17 namespace net { 18 namespace net {
18 namespace test { 19 namespace test {
19 20
20 class HeaderCoalescerTest : public ::testing::Test { 21 class HeaderCoalescerTest : public ::testing::Test {
21 public: 22 public:
23 HeaderCoalescerTest() : header_coalescer_(NetLogWithSource()) {}
24
22 protected: 25 protected:
23 HeaderCoalescer header_coalescer_; 26 HeaderCoalescer header_coalescer_;
24 }; 27 };
25 28
26 TEST_F(HeaderCoalescerTest, CorrectHeaders) { 29 TEST_F(HeaderCoalescerTest, CorrectHeaders) {
27 header_coalescer_.OnHeader(":foo", "bar"); 30 header_coalescer_.OnHeader(":foo", "bar");
28 header_coalescer_.OnHeader("baz", "qux"); 31 header_coalescer_.OnHeader("baz", "qux");
29 EXPECT_FALSE(header_coalescer_.error_seen()); 32 EXPECT_FALSE(header_coalescer_.error_seen());
30 33
31 SpdyHeaderBlock header_block = header_coalescer_.release_headers(); 34 SpdyHeaderBlock header_block = header_coalescer_.release_headers();
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 header_block, 134 header_block,
132 ElementsAre(Pair("foo_0", SpdyStringPiece(header_values[0].data(), 135 ElementsAre(Pair("foo_0", SpdyStringPiece(header_values[0].data(),
133 header_values[0].size())), 136 header_values[0].size())),
134 Pair("foo_1", SpdyStringPiece(header_values[1].data(), 137 Pair("foo_1", SpdyStringPiece(header_values[1].data(),
135 header_values[1].size())))); 138 header_values[1].size()))));
136 } 139 }
137 140
138 } // namespace test 141 } // namespace test
139 142
140 } // namespace net 143 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/chromium/header_coalescer.cc ('k') | net/spdy/chromium/spdy_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698