| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/browser/api/socket/tls_socket.h" | 5 #include "extensions/browser/api/socket/tls_socket.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); | 80 MOCK_CONST_METHOD0(GetSSLFailureState, net::SSLFailureState()); |
| 81 bool IsConnected() const override { return true; } | 81 bool IsConnected() const override { return true; } |
| 82 | 82 |
| 83 private: | 83 private: |
| 84 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); | 84 DISALLOW_COPY_AND_ASSIGN(MockSSLClientSocket); |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 class MockTCPSocket : public net::TCPClientSocket { | 87 class MockTCPSocket : public net::TCPClientSocket { |
| 88 public: | 88 public: |
| 89 explicit MockTCPSocket(const net::AddressList& address_list) | 89 explicit MockTCPSocket(const net::AddressList& address_list) |
| 90 : net::TCPClientSocket(address_list, NULL, net::NetLog::Source()) {} | 90 : net::TCPClientSocket(address_list, NULL, NULL, net::NetLog::Source()) {} |
| 91 | 91 |
| 92 MOCK_METHOD3(Read, | 92 MOCK_METHOD3(Read, |
| 93 int(net::IOBuffer* buf, | 93 int(net::IOBuffer* buf, |
| 94 int buf_len, | 94 int buf_len, |
| 95 const net::CompletionCallback& callback)); | 95 const net::CompletionCallback& callback)); |
| 96 MOCK_METHOD3(Write, | 96 MOCK_METHOD3(Write, |
| 97 int(net::IOBuffer* buf, | 97 int(net::IOBuffer* buf, |
| 98 int buf_len, | 98 int buf_len, |
| 99 const net::CompletionCallback& callback)); | 99 const net::CompletionCallback& callback)); |
| 100 MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay)); | 100 MOCK_METHOD2(SetKeepAlive, bool(bool enable, int delay)); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 total_bytes_written += amount_written_invocation; | 316 total_bytes_written += amount_written_invocation; |
| 317 cb.first.Run(amount_written_invocation); | 317 cb.first.Run(amount_written_invocation); |
| 318 } | 318 } |
| 319 | 319 |
| 320 ASSERT_EQ(total_bytes_requested, total_bytes_written) | 320 ASSERT_EQ(total_bytes_requested, total_bytes_written) |
| 321 << "There should be exactly as many bytes written as originally " | 321 << "There should be exactly as many bytes written as originally " |
| 322 << "requested to Write()."; | 322 << "requested to Write()."; |
| 323 } | 323 } |
| 324 | 324 |
| 325 } // namespace extensions | 325 } // namespace extensions |
| OLD | NEW |