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 "base/memory/ref_counted.h" | 5 #include "base/memory/ref_counted.h" |
6 #include "net/base/completion_callback.h" | 6 #include "net/base/completion_callback.h" |
7 #include "net/base/net_log_unittest.h" | 7 #include "net/base/net_log_unittest.h" |
8 #include "net/spdy/buffered_spdy_framer.h" | 8 #include "net/spdy/buffered_spdy_framer.h" |
9 #include "net/spdy/spdy_stream.h" | 9 #include "net/spdy/spdy_stream.h" |
10 #include "net/spdy/spdy_http_utils.h" | 10 #include "net/spdy/spdy_http_utils.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 (*headers)[":origin"] = "http://example.com"; | 260 (*headers)[":origin"] = "http://example.com"; |
261 stream->set_spdy_headers(headers.Pass()); | 261 stream->set_spdy_headers(headers.Pass()); |
262 EXPECT_TRUE(stream->HasUrl()); | 262 EXPECT_TRUE(stream->HasUrl()); |
263 | 263 |
264 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true)); | 264 EXPECT_EQ(ERR_IO_PENDING, stream->SendRequest(true)); |
265 | 265 |
266 EXPECT_EQ(OK, callback.WaitForResult()); | 266 EXPECT_EQ(OK, callback.WaitForResult()); |
267 | 267 |
268 EXPECT_TRUE(delegate->send_headers_completed()); | 268 EXPECT_TRUE(delegate->send_headers_completed()); |
269 EXPECT_EQ("101", (*delegate->response())[":status"]); | 269 EXPECT_EQ("101", (*delegate->response())[":status"]); |
| 270 EXPECT_EQ(1, delegate->headers_sent()); |
270 EXPECT_EQ(std::string(), delegate->received_data()); | 271 EXPECT_EQ(std::string(), delegate->received_data()); |
271 // TODO(toyoshim): OnDataSent should be invoked when each data frame is sent. | 272 EXPECT_EQ(6, delegate->data_sent()); |
272 // But current implementation invokes also when each HEADERS frame is sent. | |
273 //EXPECT_EQ(6, delegate->data_sent()); | |
274 } | 273 } |
275 | 274 |
276 TEST_F(SpdyStreamSpdy3Test, PushedStream) { | 275 TEST_F(SpdyStreamSpdy3Test, PushedStream) { |
277 const char kStreamUrl[] = "http://www.google.com/"; | 276 const char kStreamUrl[] = "http://www.google.com/"; |
278 | 277 |
279 SpdySessionDependencies session_deps; | 278 SpdySessionDependencies session_deps; |
280 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps); | 279 session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps); |
281 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); | 280 SpdySessionPoolPeer pool_peer_(session_->spdy_session_pool()); |
282 scoped_refptr<SpdySession> spdy_session(CreateSpdySession()); | 281 scoped_refptr<SpdySession> spdy_session(CreateSpdySession()); |
283 | 282 |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 net::NetLog::PHASE_NONE); | 464 net::NetLog::PHASE_NONE); |
466 | 465 |
467 int stream_id2; | 466 int stream_id2; |
468 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); | 467 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); |
469 EXPECT_EQ(static_cast<int>(stream_id), stream_id2); | 468 EXPECT_EQ(static_cast<int>(stream_id), stream_id2); |
470 } | 469 } |
471 | 470 |
472 } // namespace test | 471 } // namespace test |
473 | 472 |
474 } // namespace net | 473 } // namespace net |
OLD | NEW |