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 "jingle/glue/fake_ssl_client_socket.h" | 5 #include "jingle/glue/fake_ssl_client_socket.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 } | 93 } |
94 | 94 |
95 class FakeSSLClientSocketTest : public testing::Test { | 95 class FakeSSLClientSocketTest : public testing::Test { |
96 protected: | 96 protected: |
97 FakeSSLClientSocketTest() {} | 97 FakeSSLClientSocketTest() {} |
98 | 98 |
99 ~FakeSSLClientSocketTest() override {} | 99 ~FakeSSLClientSocketTest() override {} |
100 | 100 |
101 scoped_ptr<net::StreamSocket> MakeClientSocket() { | 101 scoped_ptr<net::StreamSocket> MakeClientSocket() { |
102 return mock_client_socket_factory_.CreateTransportClientSocket( | 102 return mock_client_socket_factory_.CreateTransportClientSocket( |
103 net::AddressList(), NULL, net::NetLog::Source()); | 103 net::AddressList(), NULL, NULL, net::NetLog::Source()); |
104 } | 104 } |
105 | 105 |
106 void SetData(const net::MockConnect& mock_connect, | 106 void SetData(const net::MockConnect& mock_connect, |
107 std::vector<net::MockRead>* reads, | 107 std::vector<net::MockRead>* reads, |
108 std::vector<net::MockWrite>* writes) { | 108 std::vector<net::MockWrite>* writes) { |
109 static_socket_data_provider_.reset( | 109 static_socket_data_provider_.reset( |
110 new net::StaticSocketDataProvider( | 110 new net::StaticSocketDataProvider( |
111 reads->empty() ? NULL : &*reads->begin(), reads->size(), | 111 reads->empty() ? NULL : &*reads->begin(), reads->size(), |
112 writes->empty() ? NULL : &*writes->begin(), writes->size())); | 112 writes->empty() ? NULL : &*writes->begin(), writes->size())); |
113 static_socket_data_provider_->set_connect_data(mock_connect); | 113 static_socket_data_provider_->set_connect_data(mock_connect); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 } | 346 } |
347 | 347 |
348 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { | 348 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { |
349 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, | 349 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, |
350 VERIFY_SERVER_HELLO_ERROR); | 350 VERIFY_SERVER_HELLO_ERROR); |
351 } | 351 } |
352 | 352 |
353 } // namespace | 353 } // namespace |
354 | 354 |
355 } // namespace jingle_glue | 355 } // namespace jingle_glue |
OLD | NEW |