OLD | NEW |
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 "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 "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 session_ = SpdySessionDependencies::SpdyCreateSession( | 115 session_ = SpdySessionDependencies::SpdyCreateSession( |
116 session_deps_.get()); | 116 session_deps_.get()); |
117 HttpStreamFactory::set_use_alternate_protocols(false); | 117 HttpStreamFactory::set_use_alternate_protocols(false); |
118 HttpStreamFactory::set_force_spdy_over_ssl(false); | 118 HttpStreamFactory::set_force_spdy_over_ssl(false); |
119 HttpStreamFactory::set_force_spdy_always(false); | 119 HttpStreamFactory::set_force_spdy_always(false); |
120 | 120 |
121 std::vector<std::string> next_protos; | 121 std::vector<std::string> next_protos; |
122 next_protos.push_back("http/1.1"); | 122 next_protos.push_back("http/1.1"); |
123 next_protos.push_back("spdy/2"); | 123 next_protos.push_back("spdy/2"); |
124 next_protos.push_back("spdy/2.1"); | 124 next_protos.push_back("spdy/2.1"); |
| 125 HttpStreamFactory::set_supported_spdy_version(NPN_SPDY_21); |
125 | 126 |
126 switch (test_type_) { | 127 switch (test_type_) { |
127 case SPDYNPN: | 128 case SPDYNPN: |
128 session_->http_server_properties()->SetAlternateProtocol( | 129 session_->http_server_properties()->SetAlternateProtocol( |
129 HostPortPair("www.google.com", 80), 443, | 130 HostPortPair("www.google.com", 80), 443, |
130 NPN_SPDY_21); | 131 NPN_SPDY_21); |
131 HttpStreamFactory::set_use_alternate_protocols(true); | 132 HttpStreamFactory::set_use_alternate_protocols(true); |
132 HttpStreamFactory::set_next_protos(next_protos); | 133 HttpStreamFactory::set_next_protos(next_protos); |
133 break; | 134 break; |
134 case SPDYNOSSL: | 135 case SPDYNOSSL: |
(...skipping 5697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5832 << " Write index: " | 5833 << " Write index: " |
5833 << data->write_index(); | 5834 << data->write_index(); |
5834 | 5835 |
5835 // Verify the SYN_REPLY. | 5836 // Verify the SYN_REPLY. |
5836 HttpResponseInfo response = *trans->GetResponseInfo(); | 5837 HttpResponseInfo response = *trans->GetResponseInfo(); |
5837 EXPECT_TRUE(response.headers != NULL); | 5838 EXPECT_TRUE(response.headers != NULL); |
5838 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5839 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
5839 } | 5840 } |
5840 | 5841 |
5841 } // namespace net | 5842 } // namespace net |
OLD | NEW |