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

Side by Side Diff: net/spdy/spdy_network_transaction_unittest.cc

Issue 6488010: Propagate the remote socket address to URLRequest and to ViewHostMsg_FrameNavigate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use HostPortPair everywhere Created 9 years, 10 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
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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698