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