| 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 <cstddef> | 5 #include <cstddef> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| 11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
| 12 #include "net/base/net_log_unittest.h" | 12 #include "net/base/net_log_unittest.h" |
| 13 #include "net/base/request_priority.h" |
| 13 #include "net/spdy/buffered_spdy_framer.h" | 14 #include "net/spdy/buffered_spdy_framer.h" |
| 14 #include "net/spdy/spdy_stream.h" | 15 #include "net/spdy/spdy_stream.h" |
| 15 #include "net/spdy/spdy_http_utils.h" | 16 #include "net/spdy/spdy_http_utils.h" |
| 16 #include "net/spdy/spdy_protocol.h" | 17 #include "net/spdy/spdy_protocol.h" |
| 17 #include "net/spdy/spdy_session.h" | 18 #include "net/spdy/spdy_session.h" |
| 18 #include "net/spdy/spdy_stream_test_util.h" | 19 #include "net/spdy/spdy_stream_test_util.h" |
| 19 #include "net/spdy/spdy_test_util_common.h" | 20 #include "net/spdy/spdy_test_util_common.h" |
| 20 #include "net/spdy/spdy_test_util_spdy2.h" | 21 #include "net/spdy/spdy_test_util_spdy2.h" |
| 21 #include "net/spdy/spdy_websocket_test_util_spdy2.h" | 22 #include "net/spdy/spdy_websocket_test_util_spdy2.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 23 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 OrderedSocketData data(reads, arraysize(reads), NULL, 0); | 227 OrderedSocketData data(reads, arraysize(reads), NULL, 0); |
| 227 MockConnect connect_data(SYNCHRONOUS, OK); | 228 MockConnect connect_data(SYNCHRONOUS, OK); |
| 228 data.set_connect_data(connect_data); | 229 data.set_connect_data(connect_data); |
| 229 | 230 |
| 230 session_deps_.socket_factory->AddSocketDataProvider(&data); | 231 session_deps_.socket_factory->AddSocketDataProvider(&data); |
| 231 | 232 |
| 232 InitializeSpdySession(spdy_session, host_port_pair_); | 233 InitializeSpdySession(spdy_session, host_port_pair_); |
| 233 BoundNetLog net_log; | 234 BoundNetLog net_log; |
| 234 | 235 |
| 235 // Conjure up a stream. | 236 // Conjure up a stream. |
| 236 scoped_refptr<SpdyStream> stream = new SpdyStream(spdy_session, | 237 scoped_refptr<SpdyStream> stream = |
| 237 true, | 238 new SpdyStream(spdy_session, |
| 238 net_log); | 239 std::string(), |
| 240 DEFAULT_PRIORITY, |
| 241 kSpdyStreamInitialWindowSize, |
| 242 kSpdyStreamInitialWindowSize, |
| 243 true, |
| 244 net_log); |
| 239 stream->set_stream_id(2); | 245 stream->set_stream_id(2); |
| 240 EXPECT_FALSE(stream->response_received()); | 246 EXPECT_FALSE(stream->response_received()); |
| 241 EXPECT_FALSE(stream->HasUrl()); | 247 EXPECT_FALSE(stream->HasUrl()); |
| 242 | 248 |
| 243 // Set a couple of headers. | 249 // Set a couple of headers. |
| 244 SpdyHeaderBlock response; | 250 SpdyHeaderBlock response; |
| 245 response["url"] = kStreamUrl; | 251 response["url"] = kStreamUrl; |
| 246 stream->OnResponseReceived(response); | 252 stream->OnResponseReceived(response); |
| 247 | 253 |
| 248 // Send some basic headers. | 254 // Send some basic headers. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 int stream_id2; | 345 int stream_id2; |
| 340 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); | 346 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); |
| 341 EXPECT_EQ(static_cast<int>(stream_id), stream_id2); | 347 EXPECT_EQ(static_cast<int>(stream_id), stream_id2); |
| 342 } | 348 } |
| 343 | 349 |
| 344 } // namespace | 350 } // namespace |
| 345 | 351 |
| 346 } // namespace test | 352 } // namespace test |
| 347 | 353 |
| 348 } // namespace net | 354 } // namespace net |
| OLD | NEW |