| 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_ = | 93 session_ = CreateInsecureSpdySession(http_session_, key, BoundNetLog()); |
| 94 CreateInsecureSpdySession(http_session_.get(), key, BoundNetLog()); | |
| 95 } | 94 } |
| 96 | 95 |
| 97 void TestSendCredentials( | 96 void TestSendCredentials( |
| 98 ChannelIDService* channel_id_service, | 97 ChannelIDService* channel_id_service, |
| 99 const std::string& cert, | 98 const std::string& cert, |
| 100 const std::string& proof); | 99 const std::string& proof); |
| 101 | 100 |
| 102 SpdyTestUtil spdy_util_; | 101 SpdyTestUtil spdy_util_; |
| 103 TestNetLog net_log_; | 102 TestNetLog net_log_; |
| 104 SpdySessionDependencies session_deps_; | 103 SpdySessionDependencies session_deps_; |
| 105 scoped_ptr<SequencedSocketData> sequenced_data_; | 104 scoped_ptr<SequencedSocketData> sequenced_data_; |
| 106 scoped_ptr<HttpNetworkSession> http_session_; | 105 scoped_refptr<HttpNetworkSession> http_session_; |
| 107 base::WeakPtr<SpdySession> session_; | 106 base::WeakPtr<SpdySession> session_; |
| 108 | 107 |
| 109 private: | 108 private: |
| 110 MockECSignatureCreatorFactory ec_signature_creator_factory_; | 109 MockECSignatureCreatorFactory ec_signature_creator_factory_; |
| 111 }; | 110 }; |
| 112 | 111 |
| 113 INSTANTIATE_TEST_CASE_P(NextProto, | 112 INSTANTIATE_TEST_CASE_P(NextProto, |
| 114 SpdyHttpStreamTest, | 113 SpdyHttpStreamTest, |
| 115 testing::Values(kProtoSPDY31, | 114 testing::Values(kProtoSPDY31, |
| 116 kProtoHTTP2)); | 115 kProtoHTTP2)); |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); | 834 EXPECT_EQ(kUploadData, std::string(buf1->data(), kUploadDataSize)); |
| 836 | 835 |
| 837 ASSERT_TRUE(response.headers.get()); | 836 ASSERT_TRUE(response.headers.get()); |
| 838 ASSERT_EQ(200, response.headers->response_code()); | 837 ASSERT_EQ(200, response.headers->response_code()); |
| 839 } | 838 } |
| 840 | 839 |
| 841 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 840 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
| 842 // methods. | 841 // methods. |
| 843 | 842 |
| 844 } // namespace net | 843 } // namespace net |
| OLD | NEW |