OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/spdy/spdy_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
6 #include "base/ref_counted.h" | 6 #include "base/ref_counted.h" |
7 #include "net/base/mock_host_resolver.h" | 7 #include "net/base/mock_host_resolver.h" |
8 #include "net/base/net_errors.h" | 8 #include "net/base/net_errors.h" |
9 #include "net/base/ssl_config_service.h" | 9 #include "net/base/ssl_config_service.h" |
10 #include "net/base/ssl_config_service_defaults.h" | 10 #include "net/base/ssl_config_service_defaults.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 | 105 |
106 // Needs fixing, see http://crbug.com/28622 | 106 // Needs fixing, see http://crbug.com/28622 |
107 TEST_F(SpdyStreamTest, SendRequest) { | 107 TEST_F(SpdyStreamTest, SendRequest) { |
108 scoped_refptr<SpdySession> session(CreateSpdySession()); | 108 scoped_refptr<SpdySession> session(CreateSpdySession()); |
109 HttpRequestInfo request; | 109 HttpRequestInfo request; |
110 request.method = "GET"; | 110 request.method = "GET"; |
111 request.url = GURL("http://www.google.com/"); | 111 request.url = GURL("http://www.google.com/"); |
112 TestCompletionCallback callback; | 112 TestCompletionCallback callback; |
113 HttpResponseInfo response; | 113 HttpResponseInfo response; |
114 | 114 |
115 scoped_refptr<SpdyStream> stream(new SpdyStream(session, 1, false, NULL)); | 115 scoped_refptr<SpdyStream> stream(new SpdyStream(session, 1, false, |
| 116 BoundNetLog())); |
116 stream->SetRequestInfo(request); | 117 stream->SetRequestInfo(request); |
117 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(NULL, &response, &callback)); | 118 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(NULL, &response, &callback)); |
118 | 119 |
119 // Need to manually remove the spdy session since normally it gets removed on | 120 // Need to manually remove the spdy session since normally it gets removed on |
120 // socket close/error, but we aren't communicating over a socket here. | 121 // socket close/error, but we aren't communicating over a socket here. |
121 pool_peer_.RemoveSpdySession(session); | 122 pool_peer_.RemoveSpdySession(session); |
122 } | 123 } |
123 | 124 |
124 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 125 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
125 // methods. | 126 // methods. |
126 | 127 |
127 } // namespace | 128 } // namespace |
128 | 129 |
129 } // namespace net | 130 } // namespace net |
OLD | NEW |