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

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 7995014: Revert 102322 - For the SSL cert status, convert anonymous enum that gives bit values into a type... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
« no previous file with comments | « net/base/x509_certificate_win.cc ('k') | net/http/http_response_info.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/http/http_network_transaction.h" 5 #include "net/http/http_network_transaction.h"
6 6
7 #include <math.h> // ceil 7 #include <math.h> // ceil
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 4209 matching lines...) Expand 10 before | Expand all | Expand 10 after
4220 new HttpNetworkTransaction(CreateSession(&session_deps))); 4220 new HttpNetworkTransaction(CreateSession(&session_deps)));
4221 4221
4222 // Setup some state (which we expect ResetStateForRestart() will clear). 4222 // Setup some state (which we expect ResetStateForRestart() will clear).
4223 trans->read_buf_ = new IOBuffer(15); 4223 trans->read_buf_ = new IOBuffer(15);
4224 trans->read_buf_len_ = 15; 4224 trans->read_buf_len_ = 15;
4225 trans->request_headers_.SetHeader("Authorization", "NTLM"); 4225 trans->request_headers_.SetHeader("Authorization", "NTLM");
4226 4226
4227 // Setup state in response_ 4227 // Setup state in response_
4228 HttpResponseInfo* response = &trans->response_; 4228 HttpResponseInfo* response = &trans->response_;
4229 response->auth_challenge = new AuthChallengeInfo(); 4229 response->auth_challenge = new AuthChallengeInfo();
4230 response->ssl_info.cert_status = static_cast<CertStatus>(-1); // Nonsensical. 4230 response->ssl_info.cert_status = -15;
4231 response->response_time = base::Time::Now(); 4231 response->response_time = base::Time::Now();
4232 response->was_cached = true; // (Wouldn't ever actually be true...) 4232 response->was_cached = true; // (Wouldn't ever actually be true...)
4233 4233
4234 { // Setup state for response_.vary_data 4234 { // Setup state for response_.vary_data
4235 HttpRequestInfo request; 4235 HttpRequestInfo request;
4236 std::string temp("HTTP/1.1 200 OK\nVary: foo, bar\n\n"); 4236 std::string temp("HTTP/1.1 200 OK\nVary: foo, bar\n\n");
4237 std::replace(temp.begin(), temp.end(), '\n', '\0'); 4237 std::replace(temp.begin(), temp.end(), '\n', '\0');
4238 scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(temp)); 4238 scoped_refptr<HttpResponseHeaders> headers(new HttpResponseHeaders(temp));
4239 request.extra_headers.SetHeader("Foo", "1"); 4239 request.extra_headers.SetHeader("Foo", "1");
4240 request.extra_headers.SetHeader("bar", "23"); 4240 request.extra_headers.SetHeader("bar", "23");
(...skipping 4657 matching lines...) Expand 10 before | Expand all | Expand 10 after
8898 EXPECT_TRUE(response->was_fetched_via_spdy); 8898 EXPECT_TRUE(response->was_fetched_via_spdy);
8899 EXPECT_TRUE(response->was_npn_negotiated); 8899 EXPECT_TRUE(response->was_npn_negotiated);
8900 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data)); 8900 ASSERT_EQ(OK, ReadTransaction(&trans2, &response_data));
8901 EXPECT_EQ("hello!", response_data); 8901 EXPECT_EQ("hello!", response_data);
8902 8902
8903 HttpStreamFactory::set_next_protos(""); 8903 HttpStreamFactory::set_next_protos("");
8904 HttpStreamFactory::set_use_alternate_protocols(false); 8904 HttpStreamFactory::set_use_alternate_protocols(false);
8905 } 8905 }
8906 8906
8907 } // namespace net 8907 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_win.cc ('k') | net/http/http_response_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698