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