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

Side by Side Diff: net/spdy/spdy_log_util_unittest.cc

Issue 2832973003: Split net/spdy into core and chromium subdirectories. (Closed)
Patch Set: Fix some more build rules. Created 3 years, 8 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/spdy_log_util.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 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/spdy/spdy_log_util.h"
6
7 #include "base/values.h"
8 #include "testing/gtest/include/gtest/gtest.h"
9
10 namespace net {
11
12 TEST(SpdyLogUtilTest, ElideGoAwayDebugDataForNetLog) {
13 // Only elide for appropriate log level.
14 EXPECT_EQ(
15 "[6 bytes were stripped]",
16 ElideGoAwayDebugDataForNetLog(NetLogCaptureMode::Default(), "foobar"));
17 EXPECT_EQ("foobar",
18 ElideGoAwayDebugDataForNetLog(
19 NetLogCaptureMode::IncludeCookiesAndCredentials(), "foobar"));
20 }
21
22 TEST(SpdyLogUtilTest, ElideSpdyHeaderBlockForNetLog) {
23 SpdyHeaderBlock headers;
24 headers["foo"] = "bar";
25 headers["cookie"] = "name=value";
26
27 std::unique_ptr<base::ListValue> list =
28 ElideSpdyHeaderBlockForNetLog(headers, NetLogCaptureMode::Default());
29 EXPECT_EQ(2u, list->GetSize());
30 SpdyString field;
31 EXPECT_TRUE(list->GetString(0, &field));
32 EXPECT_EQ("foo: bar", field);
33 EXPECT_TRUE(list->GetString(1, &field));
34 EXPECT_EQ("cookie: [10 bytes were stripped]", field);
35
36 list = ElideSpdyHeaderBlockForNetLog(
37 headers, NetLogCaptureMode::IncludeCookiesAndCredentials());
38 EXPECT_EQ(2u, list->GetSize());
39 EXPECT_TRUE(list->GetString(0, &field));
40 EXPECT_EQ("foo: bar", field);
41 EXPECT_TRUE(list->GetString(1, &field));
42 EXPECT_EQ("cookie: name=value", field);
43 }
44
45 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_log_util.cc ('k') | net/spdy/spdy_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698