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 "net/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Initializes the session using SequencedSocketData. | 83 // Initializes the session using SequencedSocketData. |
84 void InitSession(MockRead* reads, | 84 void InitSession(MockRead* reads, |
85 size_t reads_count, | 85 size_t reads_count, |
86 MockWrite* writes, | 86 MockWrite* writes, |
87 size_t writes_count, | 87 size_t writes_count, |
88 const SpdySessionKey& key) { | 88 const SpdySessionKey& key) { |
89 sequenced_data_.reset( | 89 sequenced_data_.reset( |
90 new SequencedSocketData(reads, reads_count, writes, writes_count)); | 90 new SequencedSocketData(reads, reads_count, writes, writes_count)); |
91 session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get()); | 91 session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get()); |
92 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 92 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
93 session_ = CreateInsecureSpdySession(http_session_, key, BoundNetLog()); | 93 session_ = |
| 94 CreateInsecureSpdySession(http_session_.get(), key, BoundNetLog()); |
94 } | 95 } |
95 | 96 |
96 void TestSendCredentials( | 97 void TestSendCredentials( |
97 ChannelIDService* channel_id_service, | 98 ChannelIDService* channel_id_service, |
98 const std::string& cert, | 99 const std::string& cert, |
99 const std::string& proof); | 100 const std::string& proof); |
100 | 101 |
101 SpdyTestUtil spdy_util_; | 102 SpdyTestUtil spdy_util_; |
102 TestNetLog net_log_; | 103 TestNetLog net_log_; |
103 SpdySessionDependencies session_deps_; | 104 SpdySessionDependencies session_deps_; |
104 scoped_ptr<SequencedSocketData> sequenced_data_; | 105 scoped_ptr<SequencedSocketData> sequenced_data_; |
105 scoped_refptr<HttpNetworkSession> http_session_; | 106 scoped_ptr<HttpNetworkSession> http_session_; |
106 base::WeakPtr<SpdySession> session_; | 107 base::WeakPtr<SpdySession> session_; |
107 | 108 |
108 private: | 109 private: |
109 MockECSignatureCreatorFactory ec_signature_creator_factory_; | 110 MockECSignatureCreatorFactory ec_signature_creator_factory_; |
110 }; | 111 }; |
111 | 112 |
112 INSTANTIATE_TEST_CASE_P(NextProto, | 113 INSTANTIATE_TEST_CASE_P(NextProto, |
113 SpdyHttpStreamTest, | 114 SpdyHttpStreamTest, |
114 testing::Values(kProtoSPDY31, | 115 testing::Values(kProtoSPDY31, |
115 kProtoHTTP2)); | 116 kProtoHTTP2)); |
(...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); | 835 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); |
835 | 836 |
836 ASSERT_TRUE(response.headers.get()); | 837 ASSERT_TRUE(response.headers.get()); |
837 ASSERT_EQ(200, response.headers->response_code()); | 838 ASSERT_EQ(200, response.headers->response_code()); |
838 } | 839 } |
839 | 840 |
840 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 841 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
841 // methods. | 842 // methods. |
842 | 843 |
843 } // namespace net | 844 } // namespace net |
OLD | NEW |