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

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

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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_response_info.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 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 public ::testing::WithParamInterface<PersistData> { 308 public ::testing::WithParamInterface<PersistData> {
309 }; 309 };
310 310
311 TEST_P(PersistenceTest, Persist) { 311 TEST_P(PersistenceTest, Persist) {
312 const PersistData test = GetParam(); 312 const PersistData test = GetParam();
313 313
314 std::string headers = test.raw_headers; 314 std::string headers = test.raw_headers;
315 HeadersToRaw(&headers); 315 HeadersToRaw(&headers);
316 scoped_refptr<HttpResponseHeaders> parsed1(new HttpResponseHeaders(headers)); 316 scoped_refptr<HttpResponseHeaders> parsed1(new HttpResponseHeaders(headers));
317 317
318 Pickle pickle; 318 base::Pickle pickle;
319 parsed1->Persist(&pickle, test.options); 319 parsed1->Persist(&pickle, test.options);
320 320
321 PickleIterator iter(pickle); 321 base::PickleIterator iter(pickle);
322 scoped_refptr<HttpResponseHeaders> parsed2(new HttpResponseHeaders(&iter)); 322 scoped_refptr<HttpResponseHeaders> parsed2(new HttpResponseHeaders(&iter));
323 323
324 std::string h2; 324 std::string h2;
325 parsed2->GetNormalizedHeaders(&h2); 325 parsed2->GetNormalizedHeaders(&h2);
326 EXPECT_EQ(std::string(test.expected_headers), h2); 326 EXPECT_EQ(std::string(test.expected_headers), h2);
327 } 327 }
328 328
329 const struct PersistData persistence_tests[] = { 329 const struct PersistData persistence_tests[] = {
330 {HttpResponseHeaders::PERSIST_ALL, 330 {HttpResponseHeaders::PERSIST_ALL,
331 "HTTP/1.1 200 OK\n" 331 "HTTP/1.1 200 OK\n"
(...skipping 1995 matching lines...) Expand 10 before | Expand all | Expand 10 after
2327 TEST_F(HttpResponseHeadersCacheControlTest, 2327 TEST_F(HttpResponseHeadersCacheControlTest,
2328 FirstStaleWhileRevalidateValueUsed) { 2328 FirstStaleWhileRevalidateValueUsed) {
2329 InitializeHeadersWithCacheControl( 2329 InitializeHeadersWithCacheControl(
2330 "stale-while-revalidate=1,stale-while-revalidate=7200"); 2330 "stale-while-revalidate=1,stale-while-revalidate=7200");
2331 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue()); 2331 EXPECT_EQ(TimeDelta::FromSeconds(1), GetStaleWhileRevalidateValue());
2332 } 2332 }
2333 2333
2334 } // namespace 2334 } // namespace
2335 2335
2336 } // namespace net 2336 } // namespace net
OLDNEW
« no previous file with comments | « net/http/http_response_headers.cc ('k') | net/http/http_response_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698