| OLD | NEW |
| 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/base/auth.h" | 10 #include "net/base/auth.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } else { | 170 } else { |
| 171 EXPECT_TRUE(!response->was_npn_negotiated); | 171 EXPECT_TRUE(!response->was_npn_negotiated); |
| 172 EXPECT_TRUE(!response->was_alternate_protocol_available); | 172 EXPECT_TRUE(!response->was_alternate_protocol_available); |
| 173 } | 173 } |
| 174 // If SPDY is not enabled, a HTTP request should not be diverted | 174 // If SPDY is not enabled, a HTTP request should not be diverted |
| 175 // over a SSL session. | 175 // over a SSL session. |
| 176 if (!spdy_enabled_) { | 176 if (!spdy_enabled_) { |
| 177 EXPECT_EQ(request_.url.SchemeIs("https"), | 177 EXPECT_EQ(request_.url.SchemeIs("https"), |
| 178 response->was_npn_negotiated); | 178 response->was_npn_negotiated); |
| 179 } | 179 } |
| 180 EXPECT_EQ("192.0.2.33", response->socket_address.host()); |
| 181 EXPECT_EQ(0, response->socket_address.port()); |
| 180 output_.status_line = response->headers->GetStatusLine(); | 182 output_.status_line = response->headers->GetStatusLine(); |
| 181 output_.response_info = *response; // Make a copy so we can verify. | 183 output_.response_info = *response; // Make a copy so we can verify. |
| 182 output_.rv = ReadTransaction(trans_.get(), &output_.response_data); | 184 output_.rv = ReadTransaction(trans_.get(), &output_.response_data); |
| 183 return; | |
| 184 } | 185 } |
| 185 | 186 |
| 186 // Most tests will want to call this function. In particular, the MockReads | 187 // Most tests will want to call this function. In particular, the MockReads |
| 187 // should end with an empty read, and that read needs to be processed to | 188 // should end with an empty read, and that read needs to be processed to |
| 188 // ensure proper deletion of the spdy_session_pool. | 189 // ensure proper deletion of the spdy_session_pool. |
| 189 void VerifyDataConsumed() { | 190 void VerifyDataConsumed() { |
| 190 for (DataVector::iterator it = data_vector_.begin(); | 191 for (DataVector::iterator it = data_vector_.begin(); |
| 191 it != data_vector_.end(); ++it) { | 192 it != data_vector_.end(); ++it) { |
| 192 EXPECT_TRUE((*it)->at_read_eof()) << "Read count: " | 193 EXPECT_TRUE((*it)->at_read_eof()) << "Read count: " |
| 193 << (*it)->read_count() | 194 << (*it)->read_count() |
| (...skipping 5214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5408 | 5409 |
| 5409 VerifyStreamsClosed(helper); | 5410 VerifyStreamsClosed(helper); |
| 5410 | 5411 |
| 5411 // Verify the SYN_REPLY. | 5412 // Verify the SYN_REPLY. |
| 5412 EXPECT_TRUE(response.headers != NULL); | 5413 EXPECT_TRUE(response.headers != NULL); |
| 5413 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5414 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
| 5414 } | 5415 } |
| 5415 } | 5416 } |
| 5416 | 5417 |
| 5417 } // namespace net | 5418 } // namespace net |
| OLD | NEW |