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

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

Issue 2259823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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/url_request/url_request_unittest.cc ('k') | net/websockets/websocket_channel_test.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/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "base/pickle.h" 8 #include "base/pickle.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "net/base/test_completion_callback.h" 10 #include "net/base/test_completion_callback.h"
(...skipping 18 matching lines...) Expand all
29 ~TestURLRequestContext() override { AssertNoURLRequests(); } 29 ~TestURLRequestContext() override { AssertNoURLRequests(); }
30 30
31 // Gets a pointer to the cache backend. 31 // Gets a pointer to the cache backend.
32 disk_cache::Backend* GetBackend(); 32 disk_cache::Backend* GetBackend();
33 33
34 private: 34 private:
35 HttpCache cache_; 35 HttpCache cache_;
36 }; 36 };
37 37
38 TestURLRequestContext::TestURLRequestContext() 38 TestURLRequestContext::TestURLRequestContext()
39 : cache_(base::WrapUnique(new MockNetworkLayer()), 39 : cache_(base::MakeUnique<MockNetworkLayer>(),
40 HttpCache::DefaultBackend::InMemory(0), 40 HttpCache::DefaultBackend::InMemory(0),
41 true) { 41 true) {
42 set_http_transaction_factory(&cache_); 42 set_http_transaction_factory(&cache_);
43 } 43 }
44 44
45 void WriteHeaders(disk_cache::Entry* entry, int flags, 45 void WriteHeaders(disk_cache::Entry* entry, int flags,
46 const std::string& data) { 46 const std::string& data) {
47 if (data.empty()) 47 if (data.empty())
48 return; 48 return;
49 49
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 std::string data; 211 std::string data;
212 TestCompletionCallback cb1; 212 TestCompletionCallback cb1;
213 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback()); 213 rv = helper.GetEntryInfoHTML(key, &context, &data, cb1.callback());
214 EXPECT_THAT(cb1.GetResult(rv), IsOk()); 214 EXPECT_THAT(cb1.GetResult(rv), IsOk());
215 215
216 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED")); 216 EXPECT_NE(std::string::npos, data.find("RESPONSE_INFO_TRUNCATED"));
217 } 217 }
218 218
219 } // namespace net 219 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_unittest.cc ('k') | net/websockets/websocket_channel_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698