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_stream_factory_impl.h" | 5 #include "net/http/http_stream_factory_impl.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1260 scoped_refptr<HttpNetworkSession> | 1260 scoped_refptr<HttpNetworkSession> |
1261 session(SpdySessionDependencies::SpdyCreateSessionDeterministic( | 1261 session(SpdySessionDependencies::SpdyCreateSessionDeterministic( |
1262 &session_deps)); | 1262 &session_deps)); |
1263 | 1263 |
1264 // Now request a stream. | 1264 // Now request a stream. |
1265 HttpRequestInfo request_info; | 1265 HttpRequestInfo request_info; |
1266 request_info.method = "GET"; | 1266 request_info.method = "GET"; |
1267 request_info.url = GURL("ws://www.google.com:8888"); | 1267 request_info.url = GURL("ws://www.google.com:8888"); |
1268 request_info.load_flags = 0; | 1268 request_info.load_flags = 0; |
1269 | 1269 |
1270 session->http_server_properties()->SetAlternateProtocol( | 1270 session->http_server_properties()->AddAlternateProtocol( |
1271 HostPortPair("www.google.com", 8888), | 1271 HostPortPair("www.google.com", 8888), 9999, NPN_SPDY_3, 1); |
1272 9999, | |
1273 NPN_SPDY_3, | |
1274 1); | |
1275 | 1272 |
1276 SSLConfig ssl_config; | 1273 SSLConfig ssl_config; |
1277 StreamRequestWaiter waiter; | 1274 StreamRequestWaiter waiter; |
1278 WebSocketStreamCreateHelper create_helper; | 1275 WebSocketStreamCreateHelper create_helper; |
1279 scoped_ptr<HttpStreamRequest> request( | 1276 scoped_ptr<HttpStreamRequest> request( |
1280 session->http_stream_factory_for_websocket() | 1277 session->http_stream_factory_for_websocket() |
1281 ->RequestWebSocketHandshakeStream(request_info, | 1278 ->RequestWebSocketHandshakeStream(request_info, |
1282 DEFAULT_PRIORITY, | 1279 DEFAULT_PRIORITY, |
1283 ssl_config, | 1280 ssl_config, |
1284 ssl_config, | 1281 ssl_config, |
(...skipping 21 matching lines...) Expand all Loading... |
1306 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); | 1303 EXPECT_TRUE(waiter.used_proxy_info().is_direct()); |
1307 | 1304 |
1308 // Make sure there is no orphaned job. it is already canceled. | 1305 // Make sure there is no orphaned job. it is already canceled. |
1309 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( | 1306 ASSERT_EQ(0u, static_cast<HttpStreamFactoryImpl*>( |
1310 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); | 1307 session->http_stream_factory_for_websocket())->num_orphaned_jobs()); |
1311 } | 1308 } |
1312 | 1309 |
1313 } // namespace | 1310 } // namespace |
1314 | 1311 |
1315 } // namespace net | 1312 } // namespace net |
OLD | NEW |