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

Side by Side Diff: content/browser/loader/resource_dispatcher_host_unittest.cc

Issue 1414983002: Make URLRequestTestJob accept \n terminated header lines. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments mmenke Created 5 years, 1 month 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 <vector> 5 #include <vector>
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 959 matching lines...) Expand 10 before | Expand all | Expand 10 after
970 net::TestNetworkDelegate* network_delegate() { return &network_delegate_; } 970 net::TestNetworkDelegate* network_delegate() { return &network_delegate_; }
971 971
972 void EnsureSchemeIsAllowed(const std::string& scheme) { 972 void EnsureSchemeIsAllowed(const std::string& scheme) {
973 ChildProcessSecurityPolicyImpl* policy = 973 ChildProcessSecurityPolicyImpl* policy =
974 ChildProcessSecurityPolicyImpl::GetInstance(); 974 ChildProcessSecurityPolicyImpl::GetInstance();
975 if (!policy->IsWebSafeScheme(scheme)) 975 if (!policy->IsWebSafeScheme(scheme))
976 policy->RegisterWebSafeScheme(scheme); 976 policy->RegisterWebSafeScheme(scheme);
977 } 977 }
978 978
979 // Sets a particular response for any request from now on. To switch back to 979 // Sets a particular response for any request from now on. To switch back to
980 // the default bahavior, pass an empty |headers|. |headers| should be raw- 980 // the default bahavior, pass an empty |headers|. |headers| should be CR[LF]
981 // formatted (NULLs instead of EOLs). 981 // terminated.
982 void SetResponse(const std::string& headers, const std::string& data) { 982 void SetResponse(const std::string& headers, const std::string& data) {
983 response_headers_ = net::HttpUtil::AssembleRawHeaders(headers.data(), 983 response_headers_ = headers;
984 headers.size());
985 response_data_ = data; 984 response_data_ = data;
986 } 985 }
987 void SetResponse(const std::string& headers) { 986 void SetResponse(const std::string& headers) {
988 SetResponse(headers, std::string()); 987 SetResponse(headers, std::string());
989 } 988 }
990 989
991 void SendDataReceivedACKs(bool send_acks) { 990 void SendDataReceivedACKs(bool send_acks) {
992 send_data_received_acks_ = send_acks; 991 send_data_received_acks_ = send_acks;
993 } 992 }
994 993
(...skipping 2546 matching lines...) Expand 10 before | Expand all | Expand 10 after
3541 return nullptr; 3540 return nullptr;
3542 } 3541 }
3543 3542
3544 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse( 3543 net::URLRequestJob* TestURLRequestJobFactory::MaybeInterceptResponse(
3545 net::URLRequest* request, 3544 net::URLRequest* request,
3546 net::NetworkDelegate* network_delegate) const { 3545 net::NetworkDelegate* network_delegate) const {
3547 return nullptr; 3546 return nullptr;
3548 } 3547 }
3549 3548
3550 } // namespace content 3549 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/appcache/appcache_update_job_unittest.cc ('k') | content/browser/loader/resource_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698