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