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

Side by Side Diff: net/url_request/view_cache_helper_unittest.cc

Issue 182993003: Add the ability for DevTools to wrap network transactions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added optional QUIC setup in HttpCache constructor Created 6 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 | Annotate | Revision Log
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 12 matching lines...) Expand all
23 23
24 // Gets a pointer to the cache backend. 24 // Gets a pointer to the cache backend.
25 disk_cache::Backend* GetBackend(); 25 disk_cache::Backend* GetBackend();
26 26
27 private: 27 private:
28 HttpCache cache_; 28 HttpCache cache_;
29 }; 29 };
30 30
31 TestURLRequestContext::TestURLRequestContext() 31 TestURLRequestContext::TestURLRequestContext()
32 : cache_(reinterpret_cast<HttpTransactionFactory*>(NULL), NULL, 32 : cache_(reinterpret_cast<HttpTransactionFactory*>(NULL), NULL,
33 HttpCache::DefaultBackend::InMemory(0)) { 33 HttpCache::DefaultBackend::InMemory(0), false) {
34 set_http_transaction_factory(&cache_); 34 set_http_transaction_factory(&cache_);
35 } 35 }
36 36
37 void WriteHeaders(disk_cache::Entry* entry, int flags, 37 void WriteHeaders(disk_cache::Entry* entry, int flags,
38 const std::string& data) { 38 const std::string& data) {
39 if (data.empty()) 39 if (data.empty())
40 return; 40 return;
41 41
42 Pickle pickle; 42 Pickle pickle;
43 pickle.WriteInt(flags | 1); // Version 1. 43 pickle.WriteInt(flags | 1); // Version 1.
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 202
203 std::string data; 203 std::string data;
204 TestCompletionCallback cb1; 204 TestCompletionCallback cb1;
205 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); 205 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback());
206 EXPECT_EQ(OK, cb1.GetResult(rv)); 206 EXPECT_EQ(OK, cb1.GetResult(rv));
207 207
208 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); 208 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED"));
209 } 209 }
210 210
211 } // namespace net 211 } // namespace net
OLDNEW
« net/http/mock_http_cache.cc ('K') | « net/url_request/url_request_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698