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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&()); | 61 MOCK_CONST_METHOD0(NetLog, const net::BoundNetLog&()); |
62 MOCK_METHOD0(SetSubresourceSpeculation, void()); | 62 MOCK_METHOD0(SetSubresourceSpeculation, void()); |
63 MOCK_METHOD0(SetOmniboxSpeculation, void()); | 63 MOCK_METHOD0(SetOmniboxSpeculation, void()); |
64 MOCK_CONST_METHOD0(WasEverUsed, bool()); | 64 MOCK_CONST_METHOD0(WasEverUsed, bool()); |
65 MOCK_CONST_METHOD0(UsingTCPFastOpen, bool()); | 65 MOCK_CONST_METHOD0(UsingTCPFastOpen, bool()); |
66 MOCK_CONST_METHOD0(NumBytesRead, int64()); | 66 MOCK_CONST_METHOD0(NumBytesRead, int64()); |
67 MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta()); | 67 MOCK_CONST_METHOD0(GetConnectTimeMicros, base::TimeDelta()); |
68 MOCK_CONST_METHOD0(WasNpnNegotiated, bool()); | 68 MOCK_CONST_METHOD0(WasNpnNegotiated, bool()); |
69 MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto()); | 69 MOCK_CONST_METHOD0(GetNegotiatedProtocol, net::NextProto()); |
70 MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*)); | 70 MOCK_METHOD1(GetSSLInfo, bool(net::SSLInfo*)); |
| 71 MOCK_CONST_METHOD1(GetConnectionAttempts, void(net::ConnectionAttempts*)); |
| 72 MOCK_METHOD0(ClearConnectionAttempts, void()); |
| 73 MOCK_METHOD1(AddConnectionAttempts, void(const net::ConnectionAttempts&)); |
71 }; | 74 }; |
72 | 75 |
73 // Break up |data| into a bunch of chunked MockReads/Writes and push | 76 // Break up |data| into a bunch of chunked MockReads/Writes and push |
74 // them onto |ops|. | 77 // them onto |ops|. |
75 template <net::MockReadWriteType type> | 78 template <net::MockReadWriteType type> |
76 void AddChunkedOps(base::StringPiece data, size_t chunk_size, net::IoMode mode, | 79 void AddChunkedOps(base::StringPiece data, size_t chunk_size, net::IoMode mode, |
77 std::vector<net::MockReadWrite<type> >* ops) { | 80 std::vector<net::MockReadWrite<type> >* ops) { |
78 DCHECK_GT(chunk_size, 0U); | 81 DCHECK_GT(chunk_size, 0U); |
79 size_t offset = 0; | 82 size_t offset = 0; |
80 while (offset < data.size()) { | 83 while (offset < data.size()) { |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 } | 342 } |
340 | 343 |
341 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { | 344 TEST_F(FakeSSLClientSocketTest, MalformedServerHello) { |
342 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, | 345 RunUnsuccessfulHandshakeTest(ERR_MALFORMED_SERVER_HELLO, |
343 VERIFY_SERVER_HELLO_ERROR); | 346 VERIFY_SERVER_HELLO_ERROR); |
344 } | 347 } |
345 | 348 |
346 } // namespace | 349 } // namespace |
347 | 350 |
348 } // namespace jingle_glue | 351 } // namespace jingle_glue |
OLD | NEW |