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

Side by Side Diff: net/http/http_response_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_response_headers.cc ('k') | net/http/http_stream_factory_impl_job.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) 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 <algorithm> 5 #include <algorithm>
6 #include <iostream> 6 #include <iostream>
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2259 testing::ValuesIn(update_range_tests)); 2259 testing::ValuesIn(update_range_tests));
2260 2260
2261 TEST(HttpResponseHeadersTest, ToNetLogParamAndBackAgain) { 2261 TEST(HttpResponseHeadersTest, ToNetLogParamAndBackAgain) {
2262 std::string headers("HTTP/1.1 404\n" 2262 std::string headers("HTTP/1.1 404\n"
2263 "Content-Length: 450\n" 2263 "Content-Length: 450\n"
2264 "Connection: keep-alive\n"); 2264 "Connection: keep-alive\n");
2265 HeadersToRaw(&headers); 2265 HeadersToRaw(&headers);
2266 scoped_refptr<net::HttpResponseHeaders> parsed( 2266 scoped_refptr<net::HttpResponseHeaders> parsed(
2267 new net::HttpResponseHeaders(headers)); 2267 new net::HttpResponseHeaders(headers));
2268 2268
2269 scoped_ptr<base::Value> event_param( 2269 scoped_ptr<base::Value> event_param(parsed->NetLogCallback(
2270 parsed->NetLogCallback(net::NetLog::LOG_ALL_BUT_BYTES)); 2270 net::NetLogCaptureMode::IncludeCookiesAndCredentials()));
2271 scoped_refptr<net::HttpResponseHeaders> recreated; 2271 scoped_refptr<net::HttpResponseHeaders> recreated;
2272 2272
2273 ASSERT_TRUE(net::HttpResponseHeaders::FromNetLogParam(event_param.get(), 2273 ASSERT_TRUE(net::HttpResponseHeaders::FromNetLogParam(event_param.get(),
2274 &recreated)); 2274 &recreated));
2275 ASSERT_TRUE(recreated.get()); 2275 ASSERT_TRUE(recreated.get());
2276 EXPECT_EQ(parsed->GetHttpVersion(), recreated->GetHttpVersion()); 2276 EXPECT_EQ(parsed->GetHttpVersion(), recreated->GetHttpVersion());
2277 EXPECT_EQ(parsed->response_code(), recreated->response_code()); 2277 EXPECT_EQ(parsed->response_code(), recreated->response_code());
2278 EXPECT_EQ(parsed->GetContentLength(), recreated->GetContentLength()); 2278 EXPECT_EQ(parsed->GetContentLength(), recreated->GetContentLength());
2279 EXPECT_EQ(parsed->IsKeepAlive(), recreated->IsKeepAlive()); 2279 EXPECT_EQ(parsed->IsKeepAlive(), recreated->IsKeepAlive());
2280 2280
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2390 } 2390 }
2391 2391
2392 TEST_F(HttpResponseHeadersCacheControlTest, 2392 TEST_F(HttpResponseHeadersCacheControlTest,
2393 FirstStaleWhileRevalidateValueUsed) { 2393 FirstStaleWhileRevalidateValueUsed) {
2394 InitializeHeadersWithCacheControl( 2394 InitializeHeadersWithCacheControl(
2395 "stale-while-revalidate=1,stale-while-revalidate=7200"); 2395 "stale-while-revalidate=1,stale-while-revalidate=7200");
2396 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue()); 2396 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue());
2397 } 2397 }
2398 2398
2399 } // end namespace 2399 } // end namespace
OLDNEW
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698