| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 scoped_ptr<SpdyFrame> msg( | 247 scoped_ptr<SpdyFrame> msg( |
| 248 spdy_util_.ConstructSpdyBodyFrame(1, kPostBody, kPostBodyLength, false)); | 248 spdy_util_.ConstructSpdyBodyFrame(1, kPostBody, kPostBodyLength, false)); |
| 249 AddWrite(*msg); | 249 AddWrite(*msg); |
| 250 | 250 |
| 251 scoped_ptr<SpdyFrame> echo( | 251 scoped_ptr<SpdyFrame> echo( |
| 252 spdy_util_.ConstructSpdyBodyFrame(1, kPostBody, kPostBodyLength, false)); | 252 spdy_util_.ConstructSpdyBodyFrame(1, kPostBody, kPostBodyLength, false)); |
| 253 AddRead(*echo); | 253 AddRead(*echo); |
| 254 | 254 |
| 255 AddReadEOF(); | 255 AddReadEOF(); |
| 256 | 256 |
| 257 CapturingBoundNetLog log; | 257 BoundTestNetLog log; |
| 258 | 258 |
| 259 DeterministicSocketData data(GetReads(), GetNumReads(), GetWrites(), | 259 DeterministicSocketData data(GetReads(), GetNumReads(), GetWrites(), |
| 260 GetNumWrites()); | 260 GetNumWrites()); |
| 261 MockConnect connect_data(SYNCHRONOUS, OK); | 261 MockConnect connect_data(SYNCHRONOUS, OK); |
| 262 data.set_connect_data(connect_data); | 262 data.set_connect_data(connect_data); |
| 263 | 263 |
| 264 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); | 264 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); |
| 265 | 265 |
| 266 base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); | 266 base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); |
| 267 | 267 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 287 | 287 |
| 288 const SpdyStreamId stream_id = delegate.stream_id(); | 288 const SpdyStreamId stream_id = delegate.stream_id(); |
| 289 | 289 |
| 290 EXPECT_TRUE(delegate.send_headers_completed()); | 290 EXPECT_TRUE(delegate.send_headers_completed()); |
| 291 EXPECT_EQ("200", delegate.GetResponseHeaderValue(spdy_util_.GetStatusKey())); | 291 EXPECT_EQ("200", delegate.GetResponseHeaderValue(spdy_util_.GetStatusKey())); |
| 292 EXPECT_EQ(std::string(kPostBody, kPostBodyLength), | 292 EXPECT_EQ(std::string(kPostBody, kPostBodyLength), |
| 293 delegate.TakeReceivedData()); | 293 delegate.TakeReceivedData()); |
| 294 EXPECT_TRUE(data.at_write_eof()); | 294 EXPECT_TRUE(data.at_write_eof()); |
| 295 | 295 |
| 296 // Check that the NetLog was filled reasonably. | 296 // Check that the NetLog was filled reasonably. |
| 297 net::CapturingNetLog::CapturedEntryList entries; | 297 net::TestNetLog::CapturedEntryList entries; |
| 298 log.GetEntries(&entries); | 298 log.GetEntries(&entries); |
| 299 EXPECT_LT(0u, entries.size()); | 299 EXPECT_LT(0u, entries.size()); |
| 300 | 300 |
| 301 // Check that we logged SPDY_STREAM_ERROR correctly. | 301 // Check that we logged SPDY_STREAM_ERROR correctly. |
| 302 int pos = net::ExpectLogContainsSomewhere( | 302 int pos = net::ExpectLogContainsSomewhere( |
| 303 entries, 0, net::NetLog::TYPE_HTTP2_STREAM_ERROR, | 303 entries, 0, net::NetLog::TYPE_HTTP2_STREAM_ERROR, |
| 304 net::NetLog::PHASE_NONE); | 304 net::NetLog::PHASE_NONE); |
| 305 | 305 |
| 306 int stream_id2; | 306 int stream_id2; |
| 307 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); | 307 ASSERT_TRUE(entries[pos].GetIntegerValue("stream_id", &stream_id2)); |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 AddWrite(*req); | 731 AddWrite(*req); |
| 732 | 732 |
| 733 // Triggered by the overflowing call to IncreaseSendWindowSize | 733 // Triggered by the overflowing call to IncreaseSendWindowSize |
| 734 // below. | 734 // below. |
| 735 scoped_ptr<SpdyFrame> rst( | 735 scoped_ptr<SpdyFrame> rst( |
| 736 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_FLOW_CONTROL_ERROR)); | 736 spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_FLOW_CONTROL_ERROR)); |
| 737 AddWrite(*rst); | 737 AddWrite(*rst); |
| 738 | 738 |
| 739 AddReadEOF(); | 739 AddReadEOF(); |
| 740 | 740 |
| 741 CapturingBoundNetLog log; | 741 BoundTestNetLog log; |
| 742 | 742 |
| 743 DeterministicSocketData data(GetReads(), GetNumReads(), | 743 DeterministicSocketData data(GetReads(), GetNumReads(), |
| 744 GetWrites(), GetNumWrites()); | 744 GetWrites(), GetNumWrites()); |
| 745 MockConnect connect_data(SYNCHRONOUS, OK); | 745 MockConnect connect_data(SYNCHRONOUS, OK); |
| 746 data.set_connect_data(connect_data); | 746 data.set_connect_data(connect_data); |
| 747 | 747 |
| 748 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); | 748 session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data); |
| 749 | 749 |
| 750 base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); | 750 base::WeakPtr<SpdySession> session(CreateDefaultSpdySession()); |
| 751 GURL url(kStreamUrl); | 751 GURL url(kStreamUrl); |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 data.RunFor(1); // FIN | 1040 data.RunFor(1); // FIN |
| 1041 | 1041 |
| 1042 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); | 1042 EXPECT_EQ(ERR_CONNECTION_CLOSED, delegate.WaitForClose()); |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 } // namespace | 1045 } // namespace |
| 1046 | 1046 |
| 1047 } // namespace test | 1047 } // namespace test |
| 1048 | 1048 |
| 1049 } // namespace net | 1049 } // namespace net |
| OLD | NEW |