| 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 "crypto/ec_private_key.h" | 7 #include "crypto/ec_private_key.h" |
| 8 #include "crypto/ec_signature_creator.h" | 8 #include "crypto/ec_signature_creator.h" |
| 9 #include "crypto/signature_creator.h" | 9 #include "crypto/signature_creator.h" |
| 10 #include "net/base/asn1_util.h" | 10 #include "net/base/asn1_util.h" |
| 11 #include "net/base/default_server_bound_cert_store.h" | 11 #include "net/base/default_server_bound_cert_store.h" |
| 12 #include "net/http/http_response_headers.h" | 12 #include "net/http/http_response_headers.h" |
| 13 #include "net/http/http_response_info.h" | 13 #include "net/http/http_response_info.h" |
| 14 #include "net/spdy/spdy_session.h" | 14 #include "net/spdy/spdy_session.h" |
| 15 #include "net/spdy/spdy_test_util_spdy2.h" | 15 #include "net/spdy/spdy_test_util_spdy2.h" |
| 16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
| 17 | 17 |
| 18 using namespace net::test_spdy2; | 18 using namespace net::test_spdy2; |
| 19 | 19 |
| 20 namespace net { | 20 namespace net { |
| 21 | 21 |
| 22 class SpdyHttpStreamSpdy2Test : public testing::Test { | 22 class SpdyHttpStreamSpdy2Test : public testing::Test { |
| 23 public: | 23 public: |
| 24 OrderedSocketData* data() { return data_.get(); } | 24 OrderedSocketData* data() { return data_.get(); } |
| 25 protected: | 25 protected: |
| 26 SpdyHttpStreamSpdy2Test() {} | 26 SpdyHttpStreamSpdy2Test() {} |
| 27 | 27 |
| 28 virtual void SetUp() { | 28 virtual void SetUp() { |
| 29 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY2); | 29 SpdySession::set_default_protocol(kProtoSPDY2); |
| 30 } | 30 } |
| 31 | 31 |
| 32 virtual void TearDown() { | 32 virtual void TearDown() { |
| 33 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); | 33 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); |
| 34 MessageLoop::current()->RunAllPending(); | 34 MessageLoop::current()->RunAllPending(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 int InitSession(MockRead* reads, size_t reads_count, | 37 int InitSession(MockRead* reads, size_t reads_count, |
| 38 MockWrite* writes, size_t writes_count, | 38 MockWrite* writes, size_t writes_count, |
| 39 HostPortPair& host_port_pair) { | 39 HostPortPair& host_port_pair) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 // pool anymore. | 228 // pool anymore. |
| 229 EXPECT_FALSE(http_session_->spdy_session_pool()->HasSession(pair)); | 229 EXPECT_FALSE(http_session_->spdy_session_pool()->HasSession(pair)); |
| 230 EXPECT_TRUE(data()->at_read_eof()); | 230 EXPECT_TRUE(data()->at_read_eof()); |
| 231 EXPECT_TRUE(data()->at_write_eof()); | 231 EXPECT_TRUE(data()->at_write_eof()); |
| 232 } | 232 } |
| 233 | 233 |
| 234 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 234 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
| 235 // methods. | 235 // methods. |
| 236 | 236 |
| 237 } // namespace net | 237 } // namespace net |
| OLD | NEW |