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

Side by Side Diff: net/url_request/url_fetcher_impl_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
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/url_fetcher_impl.h" 5 #include "net/url_request/url_fetcher_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string.h> 8 #include <string.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // All requests for |hanging_domain| will hang on host resolution until the 172 // All requests for |hanging_domain| will hang on host resolution until the
173 // mock_resolver()->ResolveAllPending() is called. 173 // mock_resolver()->ResolveAllPending() is called.
174 explicit FetcherTestURLRequestContext(const std::string& hanging_domain) 174 explicit FetcherTestURLRequestContext(const std::string& hanging_domain)
175 : TestURLRequestContext(true), mock_resolver_(new MockHostResolver()) { 175 : TestURLRequestContext(true), mock_resolver_(new MockHostResolver()) {
176 mock_resolver_->set_ondemand_mode(true); 176 mock_resolver_->set_ondemand_mode(true);
177 mock_resolver_->rules()->AddRule(hanging_domain, "127.0.0.1"); 177 mock_resolver_->rules()->AddRule(hanging_domain, "127.0.0.1");
178 // Pass ownership to ContextStorage to ensure correct destruction order. 178 // Pass ownership to ContextStorage to ensure correct destruction order.
179 context_storage_.set_host_resolver( 179 context_storage_.set_host_resolver(
180 std::unique_ptr<HostResolver>(mock_resolver_)); 180 std::unique_ptr<HostResolver>(mock_resolver_));
181 context_storage_.set_throttler_manager( 181 context_storage_.set_throttler_manager(
182 base::WrapUnique(new URLRequestThrottlerManager())); 182 base::MakeUnique<URLRequestThrottlerManager>());
183 Init(); 183 Init();
184 } 184 }
185 185
186 MockHostResolver* mock_resolver() { return mock_resolver_; } 186 MockHostResolver* mock_resolver() { return mock_resolver_; }
187 187
188 private: 188 private:
189 MockHostResolver* mock_resolver_; 189 MockHostResolver* mock_resolver_;
190 190
191 DISALLOW_COPY_AND_ASSIGN(FetcherTestURLRequestContext); 191 DISALLOW_COPY_AND_ASSIGN(FetcherTestURLRequestContext);
192 }; 192 };
(...skipping 1343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1536 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode()); 1536 EXPECT_EQ(-1, delegate.fetcher()->GetResponseCode());
1537 EXPECT_FALSE(delegate.fetcher()->GetResponseHeaders()); 1537 EXPECT_FALSE(delegate.fetcher()->GetResponseHeaders());
1538 std::string data; 1538 std::string data;
1539 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data)); 1539 EXPECT_TRUE(delegate.fetcher()->GetResponseAsString(&data));
1540 EXPECT_TRUE(data.empty()); 1540 EXPECT_TRUE(data.empty());
1541 } 1541 }
1542 1542
1543 } // namespace 1543 } // namespace
1544 1544
1545 } // namespace net 1545 } // namespace net
OLDNEW
« no previous file with comments | « net/tools/get_server_time/get_server_time.cc ('k') | net/url_request/url_request_context_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698