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

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

Issue 2788583006: Delete content::MockURLRequestDelegate. (Closed)
Patch Set: Switch clients to net::TestDelegate instead of moving MockURLRequestDelegate. Created 3 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
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_request_test_util.h" 5 #include "net/url_request/url_request_test_util.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 request->ContinueDespiteLastError(); 248 request->ContinueDespiteLastError();
249 else 249 else
250 request->Cancel(); 250 request->Cancel();
251 } 251 }
252 252
253 void TestDelegate::OnResponseStarted(URLRequest* request, int net_error) { 253 void TestDelegate::OnResponseStarted(URLRequest* request, int net_error) {
254 // It doesn't make sense for the request to have IO pending at this point. 254 // It doesn't make sense for the request to have IO pending at this point.
255 DCHECK_NE(ERR_IO_PENDING, net_error); 255 DCHECK_NE(ERR_IO_PENDING, net_error);
256 EXPECT_FALSE(request->is_redirecting()); 256 EXPECT_FALSE(request->is_redirecting());
257 257
258 metadata_ = request->response_info().metadata;
259
258 have_full_request_headers_ = 260 have_full_request_headers_ =
259 request->GetFullRequestHeaders(&full_request_headers_); 261 request->GetFullRequestHeaders(&full_request_headers_);
260 262
261 response_started_count_++; 263 response_started_count_++;
262 request_status_ = net_error; 264 request_status_ = net_error;
263 if (cancel_in_rs_) { 265 if (cancel_in_rs_) {
264 request_status_ = request->Cancel(); 266 request_status_ = request->Cancel();
265 OnResponseCompleted(request); 267 OnResponseCompleted(request);
266 } else if (net_error != OK) { 268 } else if (net_error != OK) {
267 request_failed_ = true; 269 request_failed_ = true;
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 NetworkDelegate* network_delegate) const { 675 NetworkDelegate* network_delegate) const {
674 return main_intercept_job_.release(); 676 return main_intercept_job_.release();
675 } 677 }
676 678
677 void TestJobInterceptor::set_main_intercept_job( 679 void TestJobInterceptor::set_main_intercept_job(
678 std::unique_ptr<URLRequestJob> job) { 680 std::unique_ptr<URLRequestJob> job) {
679 main_intercept_job_ = std::move(job); 681 main_intercept_job_ = std::move(job);
680 } 682 }
681 683
682 } // namespace net 684 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698