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

Side by Side Diff: net/http/http_request_headers_unittest.cc

Issue 1059843002: Refactor NetLog::LogLevel --> NetLogCaptureMode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again to fix a merge conflict Created 5 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/http/http_request_headers.cc ('k') | net/http/http_response_headers.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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/http/http_request_headers.h" 5 #include "net/http/http_request_headers.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 headers.CopyFrom(headers2); 164 headers.CopyFrom(headers2);
165 EXPECT_EQ("B: b\r\nC: c\r\n\r\n", headers.ToString()); 165 EXPECT_EQ("B: b\r\nC: c\r\n\r\n", headers.ToString());
166 } 166 }
167 167
168 TEST(HttpRequestHeaders, ToNetLogParamAndBackAgain) { 168 TEST(HttpRequestHeaders, ToNetLogParamAndBackAgain) {
169 HttpRequestHeaders headers; 169 HttpRequestHeaders headers;
170 headers.SetHeader("B", "b"); 170 headers.SetHeader("B", "b");
171 headers.SetHeader("A", "a"); 171 headers.SetHeader("A", "a");
172 std::string request_line("GET /stuff"); 172 std::string request_line("GET /stuff");
173 173
174 scoped_ptr<base::Value> event_param( 174 scoped_ptr<base::Value> event_param(headers.NetLogCallback(
175 headers.NetLogCallback(&request_line, NetLog::LOG_ALL_BUT_BYTES)); 175 &request_line, NetLogCaptureMode::IncludeCookiesAndCredentials()));
176 HttpRequestHeaders headers2; 176 HttpRequestHeaders headers2;
177 std::string request_line2; 177 std::string request_line2;
178 178
179 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam(event_param.get(), 179 ASSERT_TRUE(HttpRequestHeaders::FromNetLogParam(event_param.get(),
180 &headers2, 180 &headers2,
181 &request_line2)); 181 &request_line2));
182 EXPECT_EQ(request_line, request_line2); 182 EXPECT_EQ(request_line, request_line2);
183 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString()); 183 EXPECT_EQ("B: b\r\nA: a\r\n\r\n", headers2.ToString());
184 } 184 }
185 185
186 } // namespace 186 } // namespace
187 187
188 } // namespace net 188 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_request_headers.cc ('k') | net/http/http_response_headers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698