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 <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ops->push_back(net::MockReadWrite<type>(mode, data.data() + offset, | 82 ops->push_back(net::MockReadWrite<type>(mode, data.data() + offset, |
83 bounded_chunk_size)); | 83 bounded_chunk_size)); |
84 offset += bounded_chunk_size; | 84 offset += bounded_chunk_size; |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 class FakeSSLClientSocketTest : public testing::Test { | 88 class FakeSSLClientSocketTest : public testing::Test { |
89 protected: | 89 protected: |
90 FakeSSLClientSocketTest() {} | 90 FakeSSLClientSocketTest() {} |
91 | 91 |
92 virtual ~FakeSSLClientSocketTest() {} | 92 ~FakeSSLClientSocketTest() override {} |
93 | 93 |
94 scoped_ptr<net::StreamSocket> MakeClientSocket() { | 94 scoped_ptr<net::StreamSocket> MakeClientSocket() { |
95 return mock_client_socket_factory_.CreateTransportClientSocket( | 95 return mock_client_socket_factory_.CreateTransportClientSocket( |
96 net::AddressList(), NULL, net::NetLog::Source()); | 96 net::AddressList(), NULL, net::NetLog::Source()); |
97 } | 97 } |
98 | 98 |
99 void SetData(const net::MockConnect& mock_connect, | 99 void SetData(const net::MockConnect& mock_connect, |
100 std::vector<net::MockRead>* reads, | 100 std::vector<net::MockRead>* reads, |
101 std::vector<net::MockWrite>* writes) { | 101 std::vector<net::MockWrite>* writes) { |
102 static_socket_data_provider_.reset( | 102 static_socket_data_provider_.reset( |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 339 } |
340 | 340 |
341 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { | 341 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { |
342 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, | 342 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, |
343 VERIFY_SERVER_HELLO_ERROR); | 343 VERIFY_SERVER_HELLO_ERROR); |
344 } | 344 } |
345 | 345 |
346 } // namespace | 346 } // namespace |
347 | 347 |
348 } // namespace jingle_glue | 348 } // namespace jingle_glue |
OLD | NEW |