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

Side by Side Diff: net/url_request/view_cache_helper_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/quic/crypto/quic_server_info.cc ('k') | ppapi/nacl_irt/ppapi_dispatcher.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 "net/url_request/view_cache_helper.h" 5 #include "net/url_request/view_cache_helper.h"
6 6
7 #include "base/pickle.h" 7 #include "base/pickle.h"
8 #include "net/base/net_errors.h" 8 #include "net/base/net_errors.h"
9 #include "net/base/test_completion_callback.h" 9 #include "net/base/test_completion_callback.h"
10 #include "net/disk_cache/disk_cache.h" 10 #include "net/disk_cache/disk_cache.h"
(...skipping 23 matching lines...) Expand all
34 : cache_(new MockNetworkLayer(), NULL, 34 : cache_(new MockNetworkLayer(), NULL,
35 HttpCache::DefaultBackend::InMemory(0)) { 35 HttpCache::DefaultBackend::InMemory(0)) {
36 set_http_transaction_factory(&cache_); 36 set_http_transaction_factory(&cache_);
37 } 37 }
38 38
39 void WriteHeaders(disk_cache::Entry* entry, int flags, 39 void WriteHeaders(disk_cache::Entry* entry, int flags,
40 const std::string& data) { 40 const std::string& data) {
41 if (data.empty()) 41 if (data.empty())
42 return; 42 return;
43 43
44 Pickle pickle; 44 base::Pickle pickle;
45 pickle.WriteInt(flags | 1); // Version 1. 45 pickle.WriteInt(flags | 1); // Version 1.
46 pickle.WriteInt64(0); 46 pickle.WriteInt64(0);
47 pickle.WriteInt64(0); 47 pickle.WriteInt64(0);
48 pickle.WriteString(data); 48 pickle.WriteString(data);
49 49
50 scoped_refptr<WrappedIOBuffer> buf(new WrappedIOBuffer( 50 scoped_refptr<WrappedIOBuffer> buf(new WrappedIOBuffer(
51 reinterpret_cast<const char*>(pickle.data()))); 51 reinterpret_cast<const char*>(pickle.data())));
52 int len = static_cast<int>(pickle.size()); 52 int len = static_cast<int>(pickle.size());
53 53
54 TestCompletionCallback cb; 54 TestCompletionCallback cb;
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 std::string data; 205 std::string data;
206 TestCompletionCallback cb1; 206 TestCompletionCallback cb1;
207 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); 207 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback());
208 EXPECT_EQ(OK, cb1.GetResult(rv)); 208 EXPECT_EQ(OK, cb1.GetResult(rv));
209 209
210 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); 210 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED"));
211 } 211 }
212 212
213 } // namespace net 213 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_server_info.cc ('k') | ppapi/nacl_irt/ppapi_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698