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

Side by Side Diff: content/browser/loader/resource_loader_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "content/browser/loader/resource_loader.h" 5 #include "content/browser/loader/resource_loader.h"
6 6
7 #include "base/files/file.h" 7 #include "base/files/file.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 info->ssl_info.connection_status = kTestConnectionStatus; 220 info->ssl_info.connection_status = kTestConnectionStatus;
221 } 221 }
222 222
223 private: 223 private:
224 ~MockHTTPSURLRequestJob() override {} 224 ~MockHTTPSURLRequestJob() override {}
225 225
226 DISALLOW_COPY_AND_ASSIGN(MockHTTPSURLRequestJob); 226 DISALLOW_COPY_AND_ASSIGN(MockHTTPSURLRequestJob);
227 }; 227 };
228 228
229 const char kRedirectHeaders[] = 229 const char kRedirectHeaders[] =
230 "HTTP/1.1 302 Found\0" 230 "HTTP/1.1 302 Found\n"
231 "Location: https://example.test\0" 231 "Location: https://example.test\n"
232 "\0"; 232 "\n";
233 233
234 class MockHTTPSJobURLRequestInterceptor : public net::URLRequestInterceptor { 234 class MockHTTPSJobURLRequestInterceptor : public net::URLRequestInterceptor {
235 public: 235 public:
236 MockHTTPSJobURLRequestInterceptor(bool redirect) : redirect_(redirect) {} 236 MockHTTPSJobURLRequestInterceptor(bool redirect) : redirect_(redirect) {}
237 ~MockHTTPSJobURLRequestInterceptor() override {} 237 ~MockHTTPSJobURLRequestInterceptor() override {}
238 238
239 // net::URLRequestInterceptor: 239 // net::URLRequestInterceptor:
240 net::URLRequestJob* MaybeInterceptRequest( 240 net::URLRequestJob* MaybeInterceptRequest(
241 net::URLRequest* request, 241 net::URLRequest* request,
242 net::NetworkDelegate* network_delegate) const override { 242 net::NetworkDelegate* network_delegate) const override {
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 ASSERT_TRUE( 1139 ASSERT_TRUE(
1140 CertStore::GetInstance()->RetrieveCert(deserialized.cert_id, &cert)); 1140 CertStore::GetInstance()->RetrieveCert(deserialized.cert_id, &cert));
1141 EXPECT_TRUE(cert->Equals(GetTestCert().get())); 1141 EXPECT_TRUE(cert->Equals(GetTestCert().get()));
1142 1142
1143 EXPECT_EQ(kTestCertError, deserialized.cert_status); 1143 EXPECT_EQ(kTestCertError, deserialized.cert_status);
1144 EXPECT_EQ(kTestConnectionStatus, deserialized.connection_status); 1144 EXPECT_EQ(kTestConnectionStatus, deserialized.connection_status);
1145 EXPECT_EQ(kTestSecurityBits, deserialized.security_bits); 1145 EXPECT_EQ(kTestSecurityBits, deserialized.security_bits);
1146 } 1146 }
1147 1147
1148 } // namespace content 1148 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698