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

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

Issue 818833004: Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 std::string headers = test.raw_headers; 339 std::string headers = test.raw_headers;
340 HeadersToRaw(&headers); 340 HeadersToRaw(&headers);
341 scoped_refptr<net::HttpResponseHeaders> parsed1( 341 scoped_refptr<net::HttpResponseHeaders> parsed1(
342 new net::HttpResponseHeaders(headers)); 342 new net::HttpResponseHeaders(headers));
343 343
344 Pickle pickle; 344 Pickle pickle;
345 parsed1->Persist(&pickle, test.options); 345 parsed1->Persist(&pickle, test.options);
346 346
347 PickleIterator iter(pickle); 347 PickleIterator iter(pickle);
348 scoped_refptr<net::HttpResponseHeaders> parsed2( 348 scoped_refptr<net::HttpResponseHeaders> parsed2(
349 new net::HttpResponseHeaders(pickle, &iter)); 349 new net::HttpResponseHeaders(&iter));
350 350
351 std::string h2; 351 std::string h2;
352 parsed2->GetNormalizedHeaders(&h2); 352 parsed2->GetNormalizedHeaders(&h2);
353 EXPECT_EQ(std::string(test.expected_headers), h2); 353 EXPECT_EQ(std::string(test.expected_headers), h2);
354 } 354 }
355 355
356 const struct PersistData persistence_tests[] = { 356 const struct PersistData persistence_tests[] = {
357 { net::HttpResponseHeaders::PERSIST_ALL, 357 { net::HttpResponseHeaders::PERSIST_ALL,
358 "HTTP/1.1 200 OK\n" 358 "HTTP/1.1 200 OK\n"
359 "Cache-control:private\n" 359 "Cache-control:private\n"
(...skipping 2030 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_response_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698