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