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" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class SpdyHttpStreamSpdy3Test : public testing::Test { | 22 class SpdyHttpStreamSpdy3Test : public testing::Test { |
23 public: | 23 public: |
24 OrderedSocketData* data() { return data_.get(); } | 24 OrderedSocketData* data() { return data_.get(); } |
25 protected: | 25 protected: |
26 SpdyHttpStreamSpdy3Test() {} | 26 SpdyHttpStreamSpdy3Test() {} |
27 | 27 |
28 void EnableCompression(bool enabled) { | 28 void EnableCompression(bool enabled) { |
29 spdy::SpdyFramer::set_enable_compression_default(enabled); | 29 spdy::SpdyFramer::set_enable_compression_default(enabled); |
30 } | 30 } |
31 | 31 |
| 32 virtual void SetUp() { |
| 33 SpdySession::set_default_protocol(SSLClientSocket::kProtoSPDY3); |
| 34 } |
| 35 |
32 virtual void TearDown() { | 36 virtual void TearDown() { |
33 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); | 37 crypto::ECSignatureCreator::SetFactoryForTesting(NULL); |
34 MessageLoop::current()->RunAllPending(); | 38 MessageLoop::current()->RunAllPending(); |
35 } | 39 } |
| 40 |
36 int InitSession(MockRead* reads, size_t reads_count, | 41 int InitSession(MockRead* reads, size_t reads_count, |
37 MockWrite* writes, size_t writes_count, | 42 MockWrite* writes, size_t writes_count, |
38 HostPortPair& host_port_pair) { | 43 HostPortPair& host_port_pair) { |
39 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); | 44 HostPortProxyPair pair(host_port_pair, ProxyServer::Direct()); |
40 data_.reset(new OrderedSocketData(reads, reads_count, | 45 data_.reset(new OrderedSocketData(reads, reads_count, |
41 writes, writes_count)); | 46 writes, writes_count)); |
42 session_deps_.socket_factory->AddSocketDataProvider(data_.get()); | 47 session_deps_.socket_factory->AddSocketDataProvider(data_.get()); |
43 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); | 48 http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_); |
44 session_ = http_session_->spdy_session_pool()->Get(pair, BoundNetLog()); | 49 session_ = http_session_->spdy_session_pool()->Get(pair, BoundNetLog()); |
45 transport_params_ = new TransportSocketParams(host_port_pair, | 50 transport_params_ = new TransportSocketParams(host_port_pair, |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
462 | 467 |
463 TestSendCredentials(obc_service.get(), cert, proof, CLIENT_CERT_ECDSA_SIGN); | 468 TestSendCredentials(obc_service.get(), cert, proof, CLIENT_CERT_ECDSA_SIGN); |
464 } | 469 } |
465 | 470 |
466 #endif // !defined(USE_OPENSSL) | 471 #endif // !defined(USE_OPENSSL) |
467 | 472 |
468 // TODO(willchan): Write a longer test for SpdyStream that exercises all | 473 // TODO(willchan): Write a longer test for SpdyStream that exercises all |
469 // methods. | 474 // methods. |
470 | 475 |
471 } // namespace net | 476 } // namespace net |
OLD | NEW |